From e0a9e17cb661d428e99455f37347e18ab5a4d0d4 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Wed, 10 Oct 2018 11:04:44 -0700 Subject: [PATCH] Use new Nox (#6175) --- .../google-cloud-trace/{nox.py => noxfile.py} | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) rename packages/google-cloud-trace/{nox.py => noxfile.py} (84%) diff --git a/packages/google-cloud-trace/nox.py b/packages/google-cloud-trace/noxfile.py similarity index 84% rename from packages/google-cloud-trace/nox.py rename to packages/google-cloud-trace/noxfile.py index b248b21771a7..d636041905cb 100644 --- a/packages/google-cloud-trace/nox.py +++ b/packages/google-cloud-trace/noxfile.py @@ -25,7 +25,6 @@ ) -@nox.session def default(session): """Default unit test session. @@ -54,49 +53,38 @@ def default(session): ) -@nox.session -@nox.parametrize('py', ['2.7', '3.5', '3.6', '3.7']) -def unit(session, py): +@nox.session(python=['2.7', '3.5', '3.6', '3.7']) +def unit(session): """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) -@nox.session +@nox.session(python='3.6') def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ - session.interpreter = 'python3.6' session.install('flake8', *LOCAL_DEPS) session.install('.') session.run('flake8', 'google', 'tests') -@nox.session +@nox.session(python='3.6') def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" - session.interpreter = 'python3.6' session.install('docutils', 'pygments') session.run( 'python', 'setup.py', 'check', '--restructuredtext', '--strict') -@nox.session +@nox.session(python='3.6') def cover(session): """Run the final coverage report. This outputs the coverage report aggregating coverage from the unit test runs (not system test runs), and then erases coverage data. """ - session.interpreter = 'python3.6' session.install('coverage', 'pytest-cov') session.run('coverage', 'report', '--show-missing', '--fail-under=100') session.run('coverage', 'erase')