summaryrefslogtreecommitdiff
path: root/noxfile.py
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-19 15:15:07 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-19 15:21:26 -0500
commita0ac951a90b050a5d48158a9a33cabbc362f70db (patch)
treeed1be90a08d1905915faa2ab749e523109559eab /noxfile.py
parent899d706db01ffdbf51351f0917879a15354def6a (diff)
downloadrequests-cache-a0ac951a90b050a5d48158a9a33cabbc362f70db.tar.gz
Run pytest --verbose in CI
Diffstat (limited to 'noxfile.py')
-rw-r--r--noxfile.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/noxfile.py b/noxfile.py
index 737e266..93f6cbc 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -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')