-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running doctest prevents complete coverage collection #575
Comments
Thanks to @chriswithers for the original report. |
A simpler reproducer, with no doctest: sample.py:
swap.py:
Three runs:
I'm not sure why |
More details as they dribble in: this also happens with coverage.py 3.7.1. Seems that if the file that does the settrace(gettrace) isn't being traced itself, the problem happens. This is why it happens with doctest, and with my own file without |
Fixed in 03b48c292790 (bb) |
I'm aiming for within a week. |
sample.py:
Running coverage leaves the last two lines unmeasured:
Switching from the C tracer to the Python tracer fixes it:
The problem only appears in Python 3. It's due to the sys.settrace in the finally clause in this commit: python/cpython@31f5929, which was to fix this bug: http://bugs.python.org/issue10990
There seems to be something wrong with getting and restoring the C trace function. (Odd though, since there are tests that check this...)
The text was updated successfully, but these errors were encountered: