pytest-cov icon indicating copy to clipboard operation
pytest-cov copied to clipboard

Support .coverage.host.number.number

Open mandjevant opened this issue 3 years ago • 12 comments

Please go over all the sections and search https://pytest-cov.readthedocs.io/en/latest/ or https://coverage.readthedocs.io/en/latest/ before opening the issue.

Summary

I'm configuring pytest on my existing repository with 130 tests. All tests make use of multiprocessing. Simple Process and Pipe where I am joining the Process.

During tests, thousands of .coverage.host.number.number files are created.

Expected vs actual result

Actual result: A simple test pytest --cov project tests/test_file (with two test cases) produces 40 .coverage files. When all tests are finished, the files are merged into a single .coverage file.

Scaling this to 130 tests yields thousands of .coverage.host.number.number files. This has a significant effect on the execution time of the tests.

Expected result: A reasonable amount of temporary .coverage.host.number.number files.

Versions

pytest 7.0.0 pytest-cov 3.0.0 coverage 6.2

Also tested coverage 6.3.1

Issue

I expect I am misusing pytest (while I'm following all subprocess guidelines in the docs). Or what happens is normal but my expectations are different. I'd like some advice on this.

mandjevant avatar Feb 12 '22 12:02 mandjevant