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