24
24
)
25
25
26
26
27
- @nox .session
28
27
def default (session ):
29
28
"""Run the unit test suite.
30
29
@@ -49,32 +48,20 @@ def default(session):
49
48
)
50
49
51
50
52
- @nox .session
53
- @nox .parametrize ('py' , ['2.7' , '3.5' , '3.6' , '3.7' ])
54
- def unit (session , py ):
51
+ @nox .session (python = ['2.7' , '3.5' , '3.6' , '3.7' ])
52
+ def unit (session ):
55
53
"""Run the unit test suite."""
56
54
57
- # Run unit tests against all supported versions of Python.
58
- session .interpreter = 'python{}' .format (py )
59
-
60
- # Set the virtualenv dirname.
61
- session .virtualenv_dirname = 'unit-' + py
62
-
63
55
default (session )
64
56
65
57
66
- @nox .session
67
- @nox .parametrize ('py' , ['2.7' , '3.6' ])
68
- def system (session , py ):
58
+ @nox .session (python = ['2.7' , '3.6' ])
59
+ def system (session ):
69
60
"""Run the system test suite."""
70
61
71
62
if not os .environ .get ('GOOGLE_APPLICATION_CREDENTIALS' , '' ):
72
63
session .skip ('Credentials must be set via environment variable.' )
73
64
74
- session .interpreter = 'python{}' .format (py )
75
-
76
- session .virtualenv_dirname = 'sys-' + py
77
-
78
65
# Use pre-release gRPC for system tests.
79
66
session .install ('--pre' , 'grpcio' )
80
67
@@ -85,36 +72,33 @@ def system(session, py):
85
72
os .path .join ('tests' , 'system' ), * session .posargs )
86
73
87
74
88
- @nox .session
75
+ @nox .session ( python = '3.6' )
89
76
def lint (session ):
90
77
"""Run linters.
91
78
92
79
Returns a failure if the linters find linting errors or sufficiently
93
80
serious code quality issues.
94
81
"""
95
- session .interpreter = 'python3.6'
96
82
session .install ('flake8' , * LOCAL_DEPS )
97
83
session .install ('.' )
98
84
session .run ('flake8' , 'google' , 'tests' )
99
85
100
86
101
- @nox .session
87
+ @nox .session ( python = '3.6' )
102
88
def lint_setup_py (session ):
103
89
"""Verify that setup.py is valid (including RST check)."""
104
- session .interpreter = 'python3.6'
105
90
session .install ('docutils' , 'pygments' )
106
91
session .run ('python' , 'setup.py' , 'check' , '--restructuredtext' ,
107
92
'--strict' )
108
93
109
94
110
- @nox .session
95
+ @nox .session ( python = '3.6' )
111
96
def cover (session ):
112
97
"""Run the final coverage report.
113
98
114
99
This outputs the coverage report aggregating coverage from the unit
115
100
test runs (not system test runs), and then erases coverage data.
116
101
"""
117
- session .interpreter = 'python3.6'
118
102
session .chdir (os .path .dirname (__file__ ))
119
103
session .install ('coverage' , 'pytest-cov' )
120
104
session .run ('coverage' , 'report' , '--show-missing' , '--fail-under=100' )
0 commit comments