Skip to content

Commit 5fb1a64

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent f45e0a6 commit 5fb1a64

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

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

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

2626

27-
@nox.session
2827
def default(session):
2928
"""Run the unit test suite.
3029
@@ -49,32 +48,20 @@ def default(session):
4948
)
5049

5150

52-
@nox.session
53-
@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7'])
54-
def unit(session, py):
51+
@nox.session(python=['2.7', '3.5', '3.6', '3.7'])
52+
def unit(session):
5553
"""Run the unit test suite."""
5654

57-
# Run unit tests against all supported versions of Python.
58-
session.interpreter = 'python{}'.format(py)
59-
60-
# Set the virtualenv dirname.
61-
session.virtualenv_dirname = 'unit-' + py
62-
6355
default(session)
6456

6557

66-
@nox.session
67-
@nox.parametrize('py', ['2.7', '3.6'])
68-
def system(session, py):
58+
@nox.session(python=['2.7', '3.6'])
59+
def system(session):
6960
"""Run the system test suite."""
7061

7162
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
7263
session.skip('Credentials must be set via environment variable.')
7364

74-
session.interpreter = 'python{}'.format(py)
75-
76-
session.virtualenv_dirname = 'sys-' + py
77-
7865
# Use pre-release gRPC for system tests.
7966
session.install('--pre', 'grpcio')
8067

@@ -85,36 +72,33 @@ def system(session, py):
8572
os.path.join('tests', 'system'), *session.posargs)
8673

8774

88-
@nox.session
75+
@nox.session(python='3.6')
8976
def lint(session):
9077
"""Run linters.
9178
9279
Returns a failure if the linters find linting errors or sufficiently
9380
serious code quality issues.
9481
"""
95-
session.interpreter = 'python3.6'
9682
session.install('flake8', *LOCAL_DEPS)
9783
session.install('.')
9884
session.run('flake8', 'google', 'tests')
9985

10086

101-
@nox.session
87+
@nox.session(python='3.6')
10288
def lint_setup_py(session):
10389
"""Verify that setup.py is valid (including RST check)."""
104-
session.interpreter = 'python3.6'
10590
session.install('docutils', 'pygments')
10691
session.run('python', 'setup.py', 'check', '--restructuredtext',
10792
'--strict')
10893

10994

110-
@nox.session
95+
@nox.session(python='3.6')
11196
def cover(session):
11297
"""Run the final coverage report.
11398
11499
This outputs the coverage report aggregating coverage from the unit
115100
test runs (not system test runs), and then erases coverage data.
116101
"""
117-
session.interpreter = 'python3.6'
118102
session.chdir(os.path.dirname(__file__))
119103
session.install('coverage', 'pytest-cov')
120104
session.run('coverage', 'report', '--show-missing', '--fail-under=100')

0 commit comments

Comments
 (0)