diff --git a/pytest.ini b/pytest.ini index f1ad25c..94a761b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,6 +7,7 @@ addopts = --verbose --tb=short --cov=src/cleverswarm_python_client + --cov-config=.coveragerc --cov-report=html --cov-report=term-missing --cov-fail-under=85 diff --git a/tox.ini b/tox.ini index 6e33bc7..c666332 100644 --- a/tox.ini +++ b/tox.ini @@ -10,8 +10,11 @@ deps = pytest-html>=4.1.1 requests>=2.32.4 httmock>=1.3.0 +# Isolate coverage database per environment to prevent conflicts in parallel runs +setenv = + COVERAGE_FILE = {envdir}/.coverage.{envname} commands = - pytest {posargs:tests} --html=unit_tests_report.html --self-contained-html --junitxml=unit_tests_report.xml --cov=cleverswarm_python_client + pytest {posargs:tests} --html=unit_tests_report.html --self-contained-html --junitxml=unit_tests_report.xml --cov=src/cleverswarm_python_client --cov-config=.coveragerc [testenv:lint] deps = @@ -36,8 +39,11 @@ deps = coverage>=5.5 requests>=2.32.4 httmock>=1.3.0 +# Use a dedicated coverage database for the coverage environment +setenv = + COVERAGE_FILE = {envdir}/.coverage commands = - pytest {posargs:tests} --cov=cleverswarm_python_client --cov-report=term --cov-report=xml:coverage_report.xml --cov-report=html + pytest {posargs:tests} --cov=src/cleverswarm_python_client --cov-config=.coveragerc --cov-report=term --cov-report=xml:coverage_report.xml --cov-report=html coverage report --fail-under=85 [testenv:format]