Skip to content

Commit 3ece875

Browse files
busunkim96theacodes
authored andcommitted
Use new Nox (#6175)
1 parent 600f095 commit 3ece875

1 file changed

Lines changed: 7 additions & 29 deletions

File tree

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

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
)
2727

2828

29-
@nox.session
3029
def default(session):
3130
"""Default unit test session.
3231
@@ -57,34 +56,20 @@ def default(session):
5756
)
5857

5958

60-
@nox.session
61-
@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7'])
62-
def unit(session, py):
59+
@nox.session(python=['2.7', '3.5', '3.6', '3.7'])
60+
def unit(session):
6361
"""Run the unit test suite."""
6462

65-
# Run unit tests against all supported versions of Python.
66-
session.interpreter = 'python{}'.format(py)
67-
68-
# Set the virtualenv dirname.
69-
session.virtualenv_dirname = 'unit-' + py
70-
7163
default(session)
7264

7365

74-
@nox.session
75-
@nox.parametrize('py', ['2.7', '3.6'])
76-
def system(session, py):
66+
@nox.session(python=['2.7', '3.6'])
67+
def system(session):
7768
"""Run the system test suite."""
7869
# Sanity check: Only run system tests if the environment variable is set.
7970
if not os.environ.get('FIRESTORE_APPLICATION_CREDENTIALS'):
8071
session.skip('Credentials must be set via environment variable.')
8172

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

@@ -103,40 +88,33 @@ def system(session, py):
10388
)
10489

10590

106-
@nox.session
91+
@nox.session(python='3.6')
10792
def lint(session):
10893
"""Run linters.
10994
11095
Returns a failure if the linters find linting errors or sufficiently
11196
serious code quality issues.
11297
"""
113-
session.interpreter = 'python3.6'
11498
session.install('flake8', *LOCAL_DEPS)
11599
session.install('.')
116100
session.run('flake8', 'google', 'tests')
117101

118102

119-
@nox.session
103+
@nox.session(python='3.6')
120104
def lint_setup_py(session):
121105
"""Verify that setup.py is valid (including RST check)."""
122-
session.interpreter = 'python3.6'
123-
124-
# Set the virtualenv dirname.
125-
session.virtualenv_dirname = 'setup'
126-
127106
session.install('docutils', 'Pygments')
128107
session.run(
129108
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
130109

131110

132-
@nox.session
111+
@nox.session(python='3.6')
133112
def cover(session):
134113
"""Run the final coverage report.
135114
136115
This outputs the coverage report aggregating coverage from the unit
137116
test runs (not system test runs), and then erases coverage data.
138117
"""
139-
session.interpreter = 'python3.6'
140118
session.chdir(os.path.dirname(__file__))
141119
session.install('coverage', 'pytest-cov')
142120
session.run('coverage', 'report', '--show-missing', '--fail-under=100')

0 commit comments

Comments
 (0)