Skip to content

Commit 2b98cb1

Browse files
authored
Making a nox -s default session for all packages. (#4324)
* Making a `nox -s default` session for all packages. * Using "default" `nox` session on AppVeyor. This was 32-bit or 64-bit Python can be used, depending on which is the active `python` / the active `nox.exe`.
1 parent 17b1504 commit 2b98cb1

File tree

1 file changed

+21
-6
lines changed
  • packages/google-cloud-trace

1 file changed

+21
-6
lines changed

packages/google-cloud-trace/nox.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626

2727

2828
@nox.session
29-
@nox.parametrize('py', ['2.7', '3.4', '3.5', '3.6'])
30-
def unit(session, py):
31-
"""Run the unit test suite."""
32-
33-
# Run unit tests against all supported versions of Python.
34-
session.interpreter = 'python{}'.format(py)
29+
def default(session):
30+
"""Default unit test session.
3531
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.
36+
"""
3637
# Install all test dependencies, then install this package in-place.
3738
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
3839
session.install('-e', '.')
@@ -51,6 +52,20 @@ def unit(session, py):
5152
)
5253

5354

55+
@nox.session
56+
@nox.parametrize('py', ['2.7', '3.4', '3.5', '3.6'])
57+
def unit(session, py):
58+
"""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+
66+
default(session)
67+
68+
5469
@nox.session
5570
def lint(session):
5671
"""Run flake8.

0 commit comments

Comments
 (0)