|
24 | 24 | )
|
25 | 25 |
|
26 | 26 |
|
27 |
| -@nox.session |
28 | 27 | def default(session):
|
29 | 28 | """Default unit test session.
|
30 | 29 |
|
@@ -52,55 +51,41 @@ def default(session):
|
52 | 51 | )
|
53 | 52 |
|
54 | 53 |
|
55 |
| -@nox.session |
56 |
| -@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7']) |
57 |
| -def unit(session, py): |
| 54 | +@nox.session(python=['2.7', '3.5', '3.6', '3.7']) |
| 55 | +def unit(session): |
58 | 56 | """Run the unit test suite."""
|
59 | 57 |
|
60 |
| - # Run unit tests against all supported versions of Python. |
61 |
| - if py != 'default': |
62 |
| - session.interpreter = 'python{}'.format(py) |
63 |
| - |
64 |
| - # Set the virtualenv directory name. |
65 |
| - session.virtualenv_dirname = 'unit-' + py |
66 |
| - |
67 | 58 | default(session)
|
68 | 59 |
|
69 | 60 |
|
70 |
| -@nox.session |
| 61 | +@nox.session(python='3.6') |
71 | 62 | def lint(session):
|
72 | 63 | """Run linters.
|
73 | 64 |
|
74 | 65 | Returns a failure if the linters find linting errors or sufficiently
|
75 | 66 | serious code quality issues.
|
76 | 67 | """
|
77 |
| - session.interpreter = 'python3.6' |
78 | 68 | session.install('flake8', *LOCAL_DEPS)
|
79 | 69 | session.install('.')
|
80 | 70 | session.run('flake8', 'google', 'tests')
|
81 | 71 |
|
82 | 72 |
|
83 |
| -@nox.session |
| 73 | +@nox.session(python='3.6') |
84 | 74 | def lint_setup_py(session):
|
85 | 75 | """Verify that setup.py is valid (including RST check)."""
|
86 |
| - session.interpreter = 'python3.6' |
87 |
| - |
88 |
| - # Set the virtualenv directory name. |
89 |
| - session.virtualenv_dirname = 'setup' |
90 | 76 |
|
91 | 77 | session.install('docutils', 'pygments')
|
92 | 78 | session.run('python', 'setup.py', 'check', '--restructuredtext',
|
93 | 79 | '--strict')
|
94 | 80 |
|
95 | 81 |
|
96 |
| -@nox.session |
| 82 | +@nox.session(python='3.6') |
97 | 83 | def cover(session):
|
98 | 84 | """Run the final coverage report.
|
99 | 85 |
|
100 | 86 | This outputs the coverage report aggregating coverage from the unit
|
101 | 87 | test runs (not system test runs), and then erases coverage data.
|
102 | 88 | """
|
103 |
| - session.interpreter = 'python3.6' |
104 | 89 | session.install('coverage', 'pytest-cov')
|
105 | 90 | session.run('coverage', 'report', '--show-missing', '--fail-under=100')
|
106 | 91 | session.run('coverage', 'erase')
|
0 commit comments