2222 os .path .join ('..' , 'api_core' ),
2323)
2424
25-
26- @nox .session
2725def default (session ):
2826 """Default unit test session.
29-
3027 This is intended to be run **without** an interpreter set, so
3128 that the current ``python`` (on the ``PATH``) or the version of
3229 Python corresponding to the ``nox`` binary the ``PATH`` can
3330 run the tests.
3431 """
32+
3533 # Install all test dependencies, then install local packages in-place.
3634 session .install (
3735 'mock' ,
@@ -58,54 +56,39 @@ def default(session):
5856 )
5957
6058
61- @nox .session
62- @nox .parametrize ('py' , ['2.7' , '3.5' , '3.6' , '3.7' ])
63- def unit (session , py ):
64- """Run the unit test suite."""
65-
66- # Run unit tests against all supported versions of Python.
67- session .interpreter = 'python{}' .format (py )
68-
69- # Set the virtualenv dirname.
70- session .virtualenv_dirname = 'unit-' + py
71-
59+ @nox .session (python = ['2.7' , '3.5' , '3.6' , '3.7' ])
60+ def unit (session ):
61+ """Default unit test session."""
7262 default (session )
7363
74-
75- @nox .session
64+ @nox .session (python = '3.6' )
7665def lint (session ):
7766 """Run linters.
7867
7968 Returns a failure if the linters find linting errors or sufficiently
8069 serious code quality issues.
8170 """
82- session .interpreter = 'python3.6'
8371 session .install ('flake8' , 'flake8-import-order' )
8472 session .install ('.' )
8573 session .run ('flake8' , 'google' , 'tests' )
8674
8775
88- @nox .session
76+ @nox .session ( python = '3.6' )
8977def lint_setup_py (session ):
9078 """Verify that setup.py is valid (including RST check)."""
91- session .interpreter = 'python3.6'
92-
93- # Set the virtualenv dirname.
94- session .virtualenv_dirname = 'setup'
9579
9680 session .install ('docutils' , 'Pygments' )
9781 session .run (
9882 'python' , 'setup.py' , 'check' , '--restructuredtext' , '--strict' )
9983
10084
101- @nox .session
85+ @nox .session ( python = '3.6' )
10286def cover (session ):
10387 """Run the final coverage report.
10488
10589 This outputs the coverage report aggregating coverage from the unit
10690 test runs (not system test runs), and then erases coverage data.
10791 """
108- session .interpreter = 'python3.6'
10992 session .install ('coverage' , 'pytest-cov' )
11093 session .run ('coverage' , 'report' , '--show-missing' , '--fail-under=100' )
11194 session .run ('coverage' , 'erase' )
0 commit comments