Skip to content

Commit becb209

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent b46df3f commit becb209

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

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

Lines changed: 7 additions & 30 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
@@ -52,35 +51,20 @@ 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."""
59-
60-
# Run unit tests against all supported versions of Python.
61-
session.interpreter = 'python{}'.format(py)
62-
63-
# Set the virtualenv dirname.
64-
session.virtualenv_dirname = 'unit-' + py
65-
6657
default(session)
6758

6859

69-
@nox.session
70-
@nox.parametrize('py', ['2.7', '3.6'])
71-
def system(session, py):
60+
@nox.session(python=['2.7', '3.6'])
61+
def system(session):
7262
"""Run the system test suite."""
7363

7464
# Sanity check: Only run system tests if the environment variable is set.
7565
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
7666
session.skip('Credentials must be set via environment variable.')
7767

78-
# Run unit tests against all supported versions of Python.
79-
session.interpreter = 'python{}'.format(py)
80-
81-
# Set the virtualenv dirname.
82-
session.virtualenv_dirname = 'sys-' + py
83-
8468
# Use pre-release gRPC for system tests.
8569
session.install('--pre', 'grpcio')
8670

@@ -98,40 +82,33 @@ def system(session, py):
9882
)
9983

10084

101-
@nox.session
85+
@nox.session(python='3.6')
10286
def lint(session):
10387
"""Run linters.
10488
10589
Returns a failure if the linters find linting errors or sufficiently
10690
serious code quality issues.
10791
"""
108-
session.interpreter = 'python3.6'
10992
session.install('flake8', *LOCAL_DEPS)
11093
session.install('.')
11194
session.run('flake8', 'google', 'tests')
11295

11396

114-
@nox.session
97+
@nox.session(python='3.6')
11598
def lint_setup_py(session):
11699
"""Verify that setup.py is valid (including RST check)."""
117-
session.interpreter = 'python3.6'
118-
119-
# Set the virtualenv dirname.
120-
session.virtualenv_dirname = 'setup'
121-
122100
session.install('docutils', 'pygments')
123101
session.run(
124102
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
125103

126104

127-
@nox.session
105+
@nox.session(python='3.6')
128106
def cover(session):
129107
"""Run the final coverage report.
130108
131109
This outputs the coverage report aggregating coverage from the unit
132110
test runs (not system test runs), and then erases coverage data.
133111
"""
134-
session.interpreter = 'python3.6'
135112
session.chdir(os.path.dirname(__file__))
136113
session.install('coverage', 'pytest-cov')
137114
session.run('coverage', 'report', '--show-missing')

0 commit comments

Comments
 (0)