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`.
diff --git a/nox.py b/nox.py
index 169fa84..de9726d 100644
--- a/nox.py
+++ b/nox.py
@@ -19,16 +19,14 @@
@nox.session
[email protected]('py', ['2.7', '3.4', '3.5', '3.6'])
-def unit(session, py):
- """Run the unit test suite."""
+def default(session):
+ """Default unit test session.
- # Run unit tests against all supported versions of Python.
- session.interpreter = 'python{}'.format(py)
-
- # Set the virtualenv dirname.
- session.virtualenv_dirname = 'unit-' + py
-
+ This is intended to be run **without** an interpreter set, so
+ that the current ``python`` (on the ``PATH``) or the version of
+ Python corresponding to the ``nox`` binary the ``PATH`` can
+ run the tests.
+ """
# Install all test dependencies, then install this package in-place.
session.install(
'mock',
@@ -54,6 +52,20 @@
@nox.session
[email protected]('py', ['2.7', '3.4', '3.5', '3.6'])
+def unit(session, py):
+ """Run the unit test suite."""
+
+ # Run unit tests against all supported versions of Python.
+ session.interpreter = 'python{}'.format(py)
+
+ # Set the virtualenv dirname.
+ session.virtualenv_dirname = 'unit-' + py
+
+ default(session)
+
+
[email protected]
def lint(session):
"""Run linters.