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

Fail gracefully when reporting on file with a syntax error #115

Closed
nedbat opened this issue Jan 31, 2011 · 1 comment
Closed

Fail gracefully when reporting on file with a syntax error #115

nedbat opened this issue Jan 31, 2011 · 1 comment
Labels
enhancement New feature or request report

Comments

@nedbat
Copy link
Owner

nedbat commented Jan 31, 2011

Originally reported by Ram Rachum (Bitbucket: coolrr, GitHub: coolrr)


I'm running coverage for a package which has a module with an //intentional// syntax error in it. This is a test package called test_garlicsim which tests that garlicsim handles syntax errors correctly.

I want to run coverage on test_garlicsim. I'm able to run the coverage analysis, but the report part fails with this error message:

Couldn't parse 'c:\documents and settings\user\my documents\python projects\garlicsim\garlicsim\test_garlicsim\test_misc
\test_simpack_grokker\test_problematic_simpacks\sample_problematic_simpacks\simpack_with_syntax_error_in_settings\settin
gs.py' as Python source: 'invalid syntax' at line 1

I want coverage to fail gracefully in this case; for example, in this case I'd be happy if it just avoided that specific troublesome module while still reporting on all the other hundreds of modules in the test_garlicsim package.


@nedbat
Copy link
Owner Author

nedbat commented Apr 10, 2011

Fixed in <<changeset 38cead369463 (bb)>>.

@nedbat nedbat closed this as completed Apr 10, 2011
@nedbat nedbat added major enhancement New feature or request report labels Jun 23, 2018
agronholm added a commit to agronholm/coveragepy that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request report
Projects
None yet
Development

No branches or pull requests

1 participant