|
20 | 20 | import nox |
21 | 21 |
|
22 | 22 |
|
23 | | -@nox.session |
24 | 23 | def default(session): |
25 | | - return unit(session, 'default') |
26 | | - |
27 | | - |
28 | | -@nox.session |
29 | | -@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7']) |
30 | | -def unit(session, py): |
31 | | - """Run the unit test suite.""" |
32 | | - |
33 | | - # Run unit tests against all supported versions of Python. |
34 | | - if py != 'default': |
35 | | - session.interpreter = 'python{}'.format(py) |
36 | | - |
37 | | - # Set the virtualenv directory name. |
38 | | - session.virtualenv_dirname = 'unit-' + py |
39 | | - |
40 | 24 | # Install all test dependencies, then install this package in-place. |
41 | 25 | session.install('pytest') |
42 | 26 | session.install('-e', '.') |
43 | 27 |
|
44 | 28 | # Run py.test against the unit tests. |
45 | 29 | session.run('py.test', '--quiet', os.path.join('tests', 'unit')) |
46 | 30 |
|
| 31 | +@nox.session(python=['2.7', '3.5', '3.6', '3.7']) |
| 32 | +def unit(session): |
| 33 | + """Run the unit test suite.""" |
| 34 | + default(session) |
47 | 35 |
|
48 | | -@nox.session |
| 36 | +@nox.session(python='3.6') |
49 | 37 | def lint_setup_py(session): |
50 | 38 | """Verify that setup.py is valid (including RST check).""" |
51 | | - session.interpreter = 'python3.6' |
52 | 39 | session.install('docutils', 'pygments') |
53 | 40 | session.run('python', 'setup.py', 'check', '--restructuredtext', |
54 | 41 | '--strict') |
0 commit comments