diff --git a/pytest.ini b/pytest.ini index 9bb5e117..53ad209c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -10,11 +10,6 @@ addopts = --color yes --showlocals --verbose - --numprocesses auto --durations 10 --durations-min 1 --strict-markers - --cov - --cov-report html - --cov-report term - --cov-report xml diff --git a/tox.ini b/tox.ini index 4b90f583..c5454329 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,9 @@ envlist = linters, unit isolated_build = True +[shared] +pytest_cov_args = --cov --cov-report html --cov-report term --cov-report xml + [testenv] description = Run all tests with {basepython} usedevelop = True @@ -20,15 +23,15 @@ commands = [testenv:unit{,-py39,-py310,-py311}] description = Run unit tests -commands = pytest {posargs:test/unit} +commands = pytest test/unit {posargs} {[shared]pytest_cov_args} [testenv:pulp-integration{-py39,-py310,-py311}] # Some of these tests must run serially because of a shared resource # (the system policy.json file). description = Run pulp integration tests commands = - pytest -n 0 -m "serial" test/pulp_integration {posargs} - pytest -m "not serial" test/pulp_integration {posargs} + pytest -n 0 -m "serial" test/pulp_integration {posargs} {[shared]pytest_cov_args} + pytest -m "not serial" test/pulp_integration {posargs} {[shared]pytest_cov_args} [testenv:integration{,-py39,-py310,-py311}] description = Run integration tests @@ -37,8 +40,8 @@ passenv = HOME KEEP_IMAGES commands = - pytest -m "not serial" test/integration {posargs} - pytest -n 0 -m "serial" test/integration {posargs} + pytest -m "not serial" test/integration {posargs} {[shared]pytest_cov_args} + pytest -n 0 -m "serial" test/integration {posargs} {[shared]pytest_cov_args} [testenv:docs] description = Build documentation