Skip to content

Commit e403dca

Browse files
committed
split up python 3.5 and 3.6-7 test logic
1 parent c7df1e4 commit e403dca

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

noxfile-template.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,27 @@ def _setup_appengine_sdk(session):
158158
)
159159
)
160160
]
161+
162+
NON_PY35_SAMPLES = [
163+
sample
164+
for sample in PY3_ONLY_SAMPLES
165+
if (
166+
str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith("functions/")
167+
or str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith(
168+
"run/"
169+
)
170+
]
171+
161172
NON_GAE_STANDARD_SAMPLES_PY2 = sorted(
162173
list((set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES)) - set(PY3_ONLY_SAMPLES))
163174
)
164175
NON_GAE_STANDARD_SAMPLES_PY3 = sorted(
165176
list(set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES))
166177
)
167178

179+
PY35_SAMPLES = sorted(
180+
list(set(NON_GAE_STANDARD_SAMPLES_PY3) - set(NON_PY35_SAMPLES))
181+
168182

169183
def _session_tests(session, sample, post_install=None):
170184
"""Runs py.test for a particular sample."""
@@ -208,7 +222,13 @@ def py2(session, sample):
208222
_session_tests(session, sample)
209223

210224

211-
@nox.session(python=["3.5", "3.6", "3.7"])
225+
@nox.session(python=["3.5"])
226+
@nox.parametrize("sample", PY35_SAMPLES)
227+
def py35(session, sample):
228+
"""Runs py.test for a sample using Python 3.5"""
229+
_session_tests(session, sample)
230+
231+
@nox.session(python=["3.6", "3.7"])
212232
@nox.parametrize("sample", NON_GAE_STANDARD_SAMPLES_PY3)
213233
def py3(session, sample):
214234
"""Runs py.test for a sample using Python 3.x"""

0 commit comments

Comments
 (0)