diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-19 15:15:07 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-19 15:21:26 -0500 |
commit | a0ac951a90b050a5d48158a9a33cabbc362f70db (patch) | |
tree | ed1be90a08d1905915faa2ab749e523109559eab /noxfile.py | |
parent | 899d706db01ffdbf51351f0917879a15354def6a (diff) | |
download | requests-cache-a0ac951a90b050a5d48158a9a33cabbc362f70db.tar.gz |
Run pytest --verbose in CI
Diffstat (limited to 'noxfile.py')
-rw-r--r-- | noxfile.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -7,6 +7,7 @@ Notes: * All other commands: the current environment will be used instead of creating new ones * Run `nox -l` to see all available commands """ +from os import getenv from os.path import join from shutil import rmtree @@ -57,11 +58,16 @@ def clean(session): @session(python=False, name='cov') def coverage(session): """Run tests and generate coverage report""" + cmd = f'pytest {UNIT_TESTS} {INTEGRATION_TESTS} -rs {XDIST_ARGS} --cov'.split(' ') + + # Add coverage formats cov_formats = session.posargs or DEFAULT_COVERAGE_FORMATS - cov_format_args = [f'--cov-report={f}' for f in cov_formats] + cmd += [f'--cov-report={f}' for f in cov_formats] - cmd = f'pytest {UNIT_TESTS} {INTEGRATION_TESTS} -rs {XDIST_ARGS} --cov' - session.run(*cmd.split(' '), *cov_format_args) + # Add verbose flag, if set by environment + if getenv('PYTEST_VERBOSE'): + cmd += ['--verbose'] + session.run(*cmd) @session(python=False, name='stress') |