Skip to content

Commit 2ccb49c

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent 353135a commit 2ccb49c

1 file changed

Lines changed: 5 additions & 26 deletions

File tree

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

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,8 @@
2525
)
2626

2727

28-
@nox.session
2928
def default(session):
3029
"""Default unit test session.
31-
32-
This is intended to be run **without** an interpreter set, so
33-
that the current ``python`` (on the ``PATH``) or the version of
34-
Python corresponding to the ``nox`` binary the ``PATH`` can
35-
run the tests.
3630
"""
3731
# Install all test dependencies, then install this package in-place.
3832
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
@@ -52,54 +46,39 @@ def default(session):
5246
)
5347

5448

55-
@nox.session
56-
@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7'])
57-
def unit(session, py):
49+
@nox.session(python=['2.7', '3.5', '3.6', '3.7'])
50+
def unit(session):
5851
"""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-
6652
default(session)
6753

6854

69-
@nox.session
55+
@nox.session(python='3.6')
7056
def lint(session):
7157
"""Run linters.
7258
7359
Returns a failure if the linters find linting errors or sufficiently
7460
serious code quality issues.
7561
"""
76-
session.interpreter = 'python3.6'
7762
session.install('flake8', *LOCAL_DEPS)
7863
session.install('.')
7964
session.run('flake8', 'google', 'tests')
8065

8166

82-
@nox.session
67+
@nox.session(python='3.6')
8368
def lint_setup_py(session):
8469
"""Verify that setup.py is valid (including RST check)."""
85-
session.interpreter = 'python3.6'
86-
87-
# Set the virtualenv dirname.
88-
session.virtualenv_dirname = 'setup'
89-
9070
session.install('docutils', 'Pygments')
9171
session.run(
9272
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
9373

9474

95-
@nox.session
75+
@nox.session(python='3.6')
9676
def cover(session):
9777
"""Run the final coverage report.
9878
9979
This outputs the coverage report aggregating coverage from the unit
10080
test runs (not system test runs), and then erases coverage data.
10181
"""
102-
session.interpreter = 'python3.6'
10382
session.install('coverage', 'pytest-cov')
10483
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
10584
session.run('coverage', 'erase')

0 commit comments

Comments
 (0)