Skip coverage reports when running pytest directly

Keep them when running via tox, though.

Related-Change: https://review.opendev.org/c/openstack/swift/+/851099
Change-Id: I1ddd1dc8a3b35a588a8ecc5667dae4da33340712
This commit is contained in:
Tim Burke 2023-01-17 12:05:02 -08:00
parent d22a754052
commit 51a944850f

View File

@ -3,7 +3,7 @@ envlist = py37,py27,pep8
minversion = 3.18.0
[pytest]
addopts = --verbose --cov=swift --cov-branch --cov-report=html:cover --cov-report term
addopts = --verbose
[testenv]
usedevelop = True
@ -16,7 +16,7 @@ deps =
commands =
find {envdir} ( -type f -o -type l ) -name "*.py[co]" -delete
find {envdir} -type d -name "__pycache__" -delete
bash -ec "pytest {posargs:test/unit} || pytest --last-failed {posargs:test/unit}"
bash -ec "pytest --cov=swift --cov-branch --cov-report=html:cover --cov-report term {posargs:test/unit} || pytest --last-failed {posargs:test/unit}"
allowlist_externals =
bash
find