@@ -26,10 +26,11 @@ import nox
2626BLACK_VERSION = "black==19.3b0"
2727BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2828
29- if os.path.exists("samples"):
30- BLACK_PATHS.append("samples")
29+ DEFAULT_PYTHON_VERSION="{{ default_python_version }}"
30+ SYSTEM_TEST_PYTHON_VERSIONS=[{% for v in system_test_python_versions %} "{{v}}"{% if not loop .last %} ,{% endif %}{% endfor %} ]
31+ UNIT_TEST_PYTHON_VERSIONS=[{% for v in unit_test_python_versions %} "{{v}}"{% if not loop .last %} ,{% endif %}{% endfor %} ]
3132
32- @nox.session(python="3.7" )
33+ @nox.session(python=DEFAULT_PYTHON_VERSION )
3334def lint(session):
3435 """Run linters.
3536
@@ -62,7 +63,7 @@ def blacken(session):
6263 )
6364
6465
65- @nox.session(python="3.7" )
66+ @nox.session(python=DEFAULT_PYTHON_VERSION )
6667def lint_setup_py(session):
6768 """Verify that setup.py is valid (including RST check)."""
6869 session.install("docutils", "pygments")
@@ -90,14 +91,13 @@ def default(session):
9091 *session.posargs,
9192 )
9293
93-
94- @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
94+ @nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
9595def unit(session):
9696 """Run the unit test suite."""
9797 default(session)
9898
9999
100- @nox.session(python=["2.7", "3.7"] )
100+ @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS )
101101def system(session):
102102 """Run the system test suite."""
103103 system_test_path = os.path.join("tests", "system.py")
@@ -149,7 +149,7 @@ def samples(session):
149149 session.run("py.test", "--quiet", "samples", *session.posargs)
150150{% endif %}
151151
152- @nox.session(python="3.7" )
152+ @nox.session(python=DEFAULT_PYTHON_VERSION )
153153def cover(session):
154154 """Run the final coverage report.
155155
@@ -161,7 +161,7 @@ def cover(session):
161161
162162 session.run("coverage", "erase")
163163
164- @nox.session(python="3.7" )
164+ @nox.session(python=DEFAULT_PYTHON_VERSION )
165165def docs(session):
166166 """Build the docs for this library."""
167167
0 commit comments