-
-
Notifications
You must be signed in to change notification settings - Fork 456
Description
Describe the bug
When the subprocess is in another directory (using cwd), patch = subprocess misses the coverage.
To Reproduce
- Using Python 3.9 to 3.13
- Using coverage 7.10.2 and 7.10.3a0.dev1 (from
git+https://github.com/nedbat/coveragepy.git@d9683239c9ede7e292eb3d58e6051b184a5dcbf2
) - commit to check: marcelotduarte/cx_Freeze@c5e210e
- commit that fix: marcelotduarte/cx_Freeze@86913f5
Expected behavior
The .coverage data files must be stored together in the main directory.
Additional context
I'm replacing pytest-cov with pure coverage now that it supports patching in the subprocess. Previously, this wasn't possible. The change is quite simple (see 3), but I ran into this issue. I made the commits into my project separately to make it easier to show this bug.
In local testing on Linux, I was getting 56.36% coverage, but after the change, this coverage dropped to 47.03% (on GitHub, the coverage is 83% and then dropped to 62%).
After much testing, I discovered the problem and resolved it by copying the data files.