-
-
Notifications
You must be signed in to change notification settings - Fork 457
Description
Describe the bug
I want to use [run]patch = subprocess
on Windows in github actions, but I get a ModuleNotFoundError
and coverage is incomplete.
To Reproduce
- Python 3.x (=3.13.5) installed with actions/setup-python on windows-latest in github actions
- The minimized test case is at https://github.com/jepler/covsub
- coverage installed with
pip install coverage
afterpip install wheel
. No other non-standard packages required - Run the github actions
Expected behavior
The subprocess patch should work in all 3 environments (linux, windows, and macos). However, it fails on Windows:
Error processing line 1 of C:\hostedtoolcache\windows\Python\3.13.5\x64\subcover.pth:
Traceback (most recent call last):
File "<frozen site>", line 207, in addpackage
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'coverage'
Remainder of file ignored
function 1
Furthermore, the overall project coverage is lower than expected, 73% instead of 96%, because the sub-processes are not covered.
(Without --fail-under= the actions would have been green because the subprocesses do return a success value)
Additional context
This is a minimized reproducer. I ran into a problem in the context of an existing project when I tried to adapt it to use patch=subprocess
.
I have some vague suspicions that maybe there's a problem with the ordering of .pth files or something like that, but it's difficult to inspect the state of a github actions vm after a failure and I didn't spend much time trying to determine the underlying cause(s).