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