From 636b08be25e7abb3f9e692a84848a3c905fd82f1 Mon Sep 17 00:00:00 2001 From: Matthew Watkins Date: Mon, 11 May 2026 12:28:22 +0100 Subject: [PATCH] Fix(coverage): Use package name in coverage source list source = ['src'] is a filesystem path; coverage.py treats entries containing a path separator as path filters. Under lfreleng-actions/python-test-action v1.1.x, which installs the package non-editably into .venv/lib/pythonX.Y/site-packages, that filter never matches the installed location and coverage reports 0% with a 'No data was collected' warning. Use the import name 'dependamerge' instead. coverage.py instruments the package wherever it is imported from. This is currently masked because addopts includes '--cov=dependamerge', which overrides the path-based source list. The fix removes the latent failure mode so the project remains correctly measured if addopts is changed or the action's flag handling evolves. [tool.coverage.paths] is left in place: it does not affect measurement (this bug) but does help when combining coverage data files from multiple environments during reporting. Co-authored-by: Claude Signed-off-by: Matthew Watkins --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a9bfa58..0069e25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,7 +122,7 @@ markers = [ ] [tool.coverage.run] -source = ["src"] +source = ["dependamerge"] omit = ["tests/*"] data_file = ".coverage" # relative_files = true