Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6637f9e

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent 0fe7c22 commit 6637f9e

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

packages/google-cloud-language/nox.py renamed to packages/google-cloud-language/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
@@ -54,35 +53,20 @@ 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."""
61-
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-
6859
default(session)
6960

7061

71-
@nox.session
72-
@nox.parametrize('py', ['2.7', '3.6'])
73-
def system(session, py):
62+
@nox.session(python=['2.7', '3.6'])
63+
def system(session):
7464
"""Run the system test suite."""
7565

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

80-
# Run the system tests against latest Python 2 and Python 3 only.
81-
session.interpreter = 'python{}'.format(py)
82-
83-
# Set the virtualenv dirname.
84-
session.virtualenv_dirname = 'sys-' + py
85-
8670
# Use pre-release gRPC for system tests.
8771
session.install('--pre', 'grpcio')
8872

@@ -98,40 +82,33 @@ def system(session, py):
9882
session.run('py.test', '--quiet', 'tests/system/')
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.install('coverage', 'pytest-cov')
136113
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
137114
session.run('coverage', 'erase')

0 commit comments

Comments
 (0)