Skip to content
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

Try to fix #745 by providing ModuleSpec for __main__. #836

Closed

Conversation

tjwalton
Copy link

@tjwalton tjwalton commented Aug 9, 2019

I investigated #745 and found the main difference (compared to running the unit test without coverage) seemed to be the lack of a __spec__ for sys.modules['__main__'], so I tried to add one.

I also added a test which triggers the problem based off @adamklein's example in the issue.

However, after the fix we don't get coverage inside the spawned process, and it locks up MultiprocessingTest when using spawn. I don't know why though. Suggestions would be appreciated.

@codecov-io
Copy link

codecov-io commented Aug 12, 2019

Codecov Report

Merging #836 into master will decrease coverage by 8.98%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #836      +/-   ##
==========================================
- Coverage   92.34%   83.35%   -8.99%     
==========================================
  Files          83       83              
  Lines       11121    11243     +122     
  Branches     1133     1146      +13     
==========================================
- Hits        10270     9372     -898     
- Misses        715     1712     +997     
- Partials      136      159      +23
Impacted Files Coverage Δ
coverage/backward.py 98.38% <100%> (+0.05%) ⬆️
tests/helpers.py 100% <100%> (ø) ⬆️
coverage/execfile.py 82.95% <100%> (+0.19%) ⬆️
tests/test_concurrency.py 92.59% <94.44%> (-5.48%) ⬇️
tests/plugin2.py 0% <0%> (-62.97%) ⬇️
tests/test_plugins.py 44.78% <0%> (-54.46%) ⬇️
tests/test_context.py 60.46% <0%> (-39.54%) ⬇️
tests/test_api.py 60.11% <0%> (-36.12%) ⬇️
tests/test_oddball.py 66.93% <0%> (-33.07%) ⬇️
tests/test_debug.py 65.97% <0%> (-31.96%) ⬇️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b30174...bed15d1. Read the comment docs.

@nedbat
Copy link
Owner

nedbat commented Nov 25, 2019

Thanks for starting this. I fixed it another way.

@nedbat nedbat closed this Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants