|
25 | 25 | )
|
26 | 26 |
|
27 | 27 |
|
28 |
| -@nox.session |
29 | 28 | def default(session):
|
30 | 29 | """Default unit test session.
|
31 | 30 |
|
@@ -54,49 +53,38 @@ 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 |
| 62 | +@nox.session(python='3.6') |
72 | 63 | def lint(session):
|
73 | 64 | """Run linters.
|
74 | 65 |
|
75 | 66 | Returns a failure if the linters find linting errors or sufficiently
|
76 | 67 | serious code quality issues.
|
77 | 68 | """
|
78 |
| - session.interpreter = 'python3.6' |
79 | 69 | session.install('flake8', *LOCAL_DEPS)
|
80 | 70 | session.install('.')
|
81 | 71 | session.run('flake8', 'google', 'tests')
|
82 | 72 |
|
83 | 73 |
|
84 |
| -@nox.session |
| 74 | +@nox.session(python='3.6') |
85 | 75 | def lint_setup_py(session):
|
86 | 76 | """Verify that setup.py is valid (including RST check)."""
|
87 |
| - session.interpreter = 'python3.6' |
88 | 77 | session.install('docutils', 'pygments')
|
89 | 78 | session.run(
|
90 | 79 | 'python', 'setup.py', 'check', '--restructuredtext', '--strict')
|
91 | 80 |
|
92 | 81 |
|
93 |
| -@nox.session |
| 82 | +@nox.session(python='3.6') |
94 | 83 | def cover(session):
|
95 | 84 | """Run the final coverage report.
|
96 | 85 | This outputs the coverage report aggregating coverage from the unit
|
97 | 86 | test runs (not system test runs), and then erases coverage data.
|
98 | 87 | """
|
99 |
| - session.interpreter = 'python3.6' |
100 | 88 | session.install('coverage', 'pytest-cov')
|
101 | 89 | session.run('coverage', 'report', '--show-missing', '--fail-under=100')
|
102 | 90 | session.run('coverage', 'erase')
|
0 commit comments