Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
On Python 3, importing a .pyc with no .py fails in the assert rewriter #2038
Pytest 3.0.3, Mac OS/X
To reproduce: get commit 694165cbea4c of coverage.py: https://bitbucket.org/ned/coveragepy/get/694165cbea4c.zip
This is with Python 3.5, py34 or py36 will also fail, with slightly different stack traces.
This test is designed to test how coverage.py handles missing .py files, so it is intentional that there is a .pyc with no .py file.
FWIW I can reproduce the issue on Windows, thanks @nedbat for packaging it so neatly: