coverage "--parallel-mode" Produces No Combined Data in CI
In --parallel-mode, coverage.py writes a separate .coverage.<host>.<pid> file per process and never merges them automatically. Skipping coverage combine leaves the report with no aggregated data - it shows 0% or "No data."
What this error means
A parallel/multiprocess test run reports No data to report or an implausibly low total, despite tests running. The .coverage.* data files exist on disk but were never combined into a single .coverage.
$ coverage report
No data to report.
$ ls -a
.coverage.runner.1234 .coverage.runner.1255 .coverage.runner.1290Common causes
combine step omitted
--parallel-mode (used with subprocesses or xdist) writes suffixed data files. Without coverage combine, coverage report finds no single .coverage to read.
Data files scattered across directories
When workers run in different cwds or containers, the .coverage.* files are not all in one place for combine to find.
How to fix it
Combine before reporting
coverage combine
coverage report -m
coverage xml # for CI uploadEnable parallel mode and a single data dir
Configure parallel mode and a stable data file location so combine finds every shard.
[tool.coverage.run]
parallel = true
data_file = ".coverage"
concurrency = ["multiprocessing"]How to prevent it
- Always
coverage combinebefore reporting in parallel mode. - Pin a single
data_filelocation so shards are found. - Gather worker data files to one directory before combining in distributed runs.