Skip to content

Commit ace29b9

Browse files
fix: Enable subprocess coverage (#289)
The default CLI test in new projects runs `__main__.py` in a subprocess, until pytest-cov 7.0.0 subprocesses were automatically included in coverage but that has now changed and we must explicitly enable it in order to avoid sudden unexpected drops in code coverage. See docs: https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html
1 parent 9d544a5 commit ace29b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

template/pyproject.toml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ filterwarnings = "error"
7171
testpaths = "docs src tests"
7272

7373
[tool.coverage.run]
74+
patch = ["subprocess"]
7475
data_file = "/tmp/{{ package_name }}.coverage"
7576

7677
[tool.coverage.paths]

0 commit comments

Comments
 (0)