Skip to content

Commit b5fd746

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent 9912910 commit b5fd746

1 file changed

Lines changed: 5 additions & 19 deletions

File tree

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
)
2626

2727

28-
@nox.session
2928
def default(session):
3029
"""Default unit test session.
3130
@@ -54,54 +53,41 @@ def default(session):
5453
)
5554

5655

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):
6058
"""Run the unit test suite."""
6159

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-
6860
default(session)
6961

7062

71-
@nox.session
63+
@nox.session(python='3.6')
7264
def lint(session):
7365
"""Run linters.
7466
7567
Returns a failure if the linters find linting errors or sufficiently
7668
serious code quality issues.
7769
"""
78-
session.interpreter = 'python3.6'
7970
session.install('flake8', *LOCAL_DEPS)
8071
session.install('.')
8172
session.run('flake8', 'google', 'tests')
8273

8374

84-
@nox.session
75+
@nox.session(python='3.6')
8576
def lint_setup_py(session):
8677
"""Verify that setup.py is valid (including RST check)."""
87-
session.interpreter = 'python3.6'
88-
89-
# Set the virtualenv dirname.
90-
session.virtualenv_dirname = 'setup'
9178

9279
session.install('docutils', 'Pygments')
9380
session.run(
9481
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
9582

9683

97-
@nox.session
84+
@nox.session(python='3.6')
9885
def cover(session):
9986
"""Run the final coverage report.
10087
10188
This outputs the coverage report aggregating coverage from the unit
10289
test runs (not system test runs), and then erases coverage data.
10390
"""
104-
session.interpreter = 'python3.6'
10591
session.install('coverage', 'pytest-cov')
10692
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
10793
session.run('coverage', 'erase')

0 commit comments

Comments
 (0)