From e1a26513c83ea6a0a5f2d8e946699b4022c9c3f8 Mon Sep 17 00:00:00 2001 From: Callum Forrester Date: Mon, 15 Sep 2025 16:29:45 +0000 Subject: [PATCH] Enable subprocess coverage 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 --- template/pyproject.toml.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 8623ebb3..ff20f827 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -71,6 +71,7 @@ filterwarnings = "error" testpaths = "docs src tests" [tool.coverage.run] +patch = ["subprocess"] data_file = "/tmp/{{ package_name }}.coverage" [tool.coverage.paths]