Skip to content

Commit f742978

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 5a34cd3 commit f742978

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

nox.py

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

2828

29+
@nox.session
30+
def default(session):
31+
"""Default unit test session.
32+
33+
This is intended to be run **without** an interpreter set, so
34+
that the current ``python`` (on the ``PATH``) or the version of
35+
Python corresponding to the ``nox`` binary the ``PATH`` can
36+
run the tests.
37+
"""
38+
# Install all test dependencies, then install this package in-place.
39+
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
40+
session.install('-e', '.')
41+
42+
# Run py.test against the unit tests.
43+
session.run(
44+
'py.test',
45+
'--quiet',
46+
'--cov=google.cloud.error_reporting',
47+
'--cov=tests.unit',
48+
'--cov-append',
49+
'--cov-config=.coveragerc',
50+
'--cov-report=',
51+
'--cov-fail-under=97',
52+
'tests/unit',
53+
)
54+
55+
2956
@nox.session
3057
@nox.parametrize('py', ['2.7', '3.4', '3.5', '3.6'])
3158
def unit(session, py):
@@ -37,16 +64,7 @@ def unit(session, py):
3764
# Set the virtualenv dirname.
3865
session.virtualenv_dirname = 'unit-' + py
3966

40-
# Install all test dependencies, then install this package in-place.
41-
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
42-
session.install('-e', '.')
43-
44-
# Run py.test against the unit tests.
45-
session.run(
46-
'py.test', '--quiet', '--cov=google.cloud.error_reporting',
47-
'--cov=tests.unit', '--cov-append', '--cov-config=.coveragerc',
48-
'--cov-report=', '--cov-fail-under=97', 'tests/unit',
49-
)
67+
default(session)
5068

5169

5270
@nox.session

0 commit comments

Comments
 (0)