@@ -54,14 +54,10 @@ def _install_test_dependencies(session):
5454 session .install ('unittest2' )
5555
5656
57- @nox .session
58- @nox .parametrize ('py' , ['2.7' , '3.4' , '3.5' , '3.6' ])
59- def unit (session , py ):
57+ @nox .session (python = ['2.7' , '3.4' , '3.5' , '3.6' ])
58+ def unit (session ):
6059 """Run the unit test suite."""
6160
62- # Run unit tests against all supported versions of Python.
63- session .interpreter = 'python{}' .format (py )
64-
6561 # Install test dependencies.
6662 _install_test_dependencies (session )
6763
@@ -86,21 +82,14 @@ def unit(session, py):
8682 )
8783
8884
89- @nox .session
90- @nox .parametrize ('py' , ['2.7' , '3.6' ])
91- def system (session , py ):
85+ @nox .session (python = ['2.7' , '3.6' ])
86+ def system (session ):
9287 """Run the system test suite."""
9388
9489 # Sanity check: Only run system tests if the environment variable is set.
9590 if not os .environ .get ('GOOGLE_APPLICATION_CREDENTIALS' , '' ):
9691 session .skip ('Credentials must be set via environment variable.' )
9792
98- # Run the system tests against latest Python 2 and Python 3 only.
99- session .interpreter = 'python{}' .format (py )
100-
101- # Set the virtualenv dirname.
102- session .virtualenv_dirname = 'sys-' + py
103-
10493 # Install test dependencies.
10594 _install_test_dependencies (session )
10695
@@ -116,13 +105,12 @@ def system(session, py):
116105 )
117106
118107
119- @nox .session
108+ @nox .session ( python = '3.6' )
120109def lint (session ):
121110 """Run flake8.
122111 Returns a failure if flake8 finds linting errors or sufficiently
123112 serious code quality issues.
124113 """
125- session .interpreter = 'python3.6'
126114 session .install ('flake8' )
127115
128116 # Install dev packages.
@@ -138,37 +126,29 @@ def lint(session):
138126 )
139127
140128
141- @nox .session
129+ @nox .session ( python = '3.6' )
142130def lint_setup_py (session ):
143131 """Verify that setup.py is valid (including RST check)."""
144- session .interpreter = 'python3.6'
145132 session .install ('docutils' , 'pygments' )
146133 session .run (
147134 'python' , 'setup.py' , 'check' , '--restructuredtext' , '--strict' )
148135
149136
150- @nox .session
137+ @nox .session ( python = '3.6' )
151138def cover (session ):
152139 """Run the final coverage report.
153140 This outputs the coverage report aggregating coverage from the unit
154141 test runs (not system test runs), and then erases coverage data.
155142 """
156- session .interpreter = 'python3.6'
157143 session .install ('coverage' , 'pytest-cov' )
158144 session .run ('coverage' , 'report' , '--show-missing' , '--fail-under=100' )
159145 session .run ('coverage' , 'erase' )
160146
161147
162- @nox .session
148+ @nox .session ( python = '3.6' )
163149def docs (session ):
164150 """Build the docs."""
165151
166- # Build docs against the latest version of Python, because we can.
167- session .interpreter = 'python3.6'
168-
169- # Set the virtualenv dirname.
170- session .virtualenv_dirname = 'docs'
171-
172152 # Install Sphinx and also all of the google-cloud-* packages.
173153 session .chdir (os .path .realpath (os .path .dirname (__file__ )))
174154 session .install ('-r' , os .path .join ('docs' , 'requirements.txt' ))
0 commit comments