diff --git a/pyproject.toml b/pyproject.toml index 724eda4..49aa4f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,10 +125,6 @@ branch = true parallel = false omit = ["tests/**"] -[tool.coverage.report] -skip_empty = true -fail_under = 74 - [tool.pyright] #strict = ["craft_cli"] # NOTE: disabled pending fix of the many errors (see gh issue #147) pythonVersion = "3.8" diff --git a/tox.ini b/tox.ini index 49ae55b..560a1a6 100644 --- a/tox.ini +++ b/tox.ini @@ -49,7 +49,12 @@ base = testenv, test description = Run integration tests with pytest labels = py38, py310, py311: tests, integration-tests -commands = pytest {tty:--color=yes} --junit-xml=results/test-results-{env_name}.xml tests/integration {posargs} +commands = + # NOTE: we use `coverage` directly here instead of pytest-cov because the loading of the + # pytest plugin provided by craft-cli means that some code gets imported *before* + # pytest-cov gets started, and those lines are marked as misses. + coverage run --source craft_cli -m pytest {tty:--color=yes} --junit-xml=results/test-results-{env_name}.xml tests/integration {posargs} + coverage xml -o results/coverage-{env_name}.xml [lint] # Standard linting configuration package = editable