Skip to content

Commit afc38ad

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent 7ee9725 commit afc38ad

File tree

1 file changed

+5
-20
lines changed
  • packages/google-cloud-websecurityscanner

1 file changed

+5
-20
lines changed

packages/google-cloud-websecurityscanner/nox.py renamed to packages/google-cloud-websecurityscanner/noxfile.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
)
2525

2626

27-
@nox.session
2827
def default(session):
2928
"""Default unit test session.
3029
@@ -52,55 +51,41 @@ def default(session):
5251
)
5352

5453

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

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-
6758
default(session)
6859

6960

70-
@nox.session
61+
@nox.session(python='3.6')
7162
def lint(session):
7263
"""Run linters.
7364
7465
Returns a failure if the linters find linting errors or sufficiently
7566
serious code quality issues.
7667
"""
77-
session.interpreter = 'python3.6'
7868
session.install('flake8', *LOCAL_DEPS)
7969
session.install('.')
8070
session.run('flake8', 'google', 'tests')
8171

8272

83-
@nox.session
73+
@nox.session(python='3.6')
8474
def lint_setup_py(session):
8575
"""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'
9076

9177
session.install('docutils', 'pygments')
9278
session.run('python', 'setup.py', 'check', '--restructuredtext',
9379
'--strict')
9480

9581

96-
@nox.session
82+
@nox.session(python='3.6')
9783
def cover(session):
9884
"""Run the final coverage report.
9985
10086
This outputs the coverage report aggregating coverage from the unit
10187
test runs (not system test runs), and then erases coverage data.
10288
"""
103-
session.interpreter = 'python3.6'
10489
session.install('coverage', 'pytest-cov')
10590
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
10691
session.run('coverage', 'erase')

0 commit comments

Comments
 (0)