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

annotate -i doesn't work #61

Closed
nedbat opened this issue Apr 20, 2010 · 3 comments
Closed

annotate -i doesn't work #61

nedbat opened this issue Apr 20, 2010 · 3 comments
Labels
annotate bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Apr 20, 2010

Originally reported by Thomas Lotze (Bitbucket: tlotze, GitHub: tlotze)


According to the help output, the annotate command should ignore errors when reading source files if the -i option is specified. However, it doesn't do so for me when it fails reading a doctest file, but simply stops creating annotations at that points. The report command, however, does ignore the same error if given -i.


@nedbat
Copy link
Owner Author

nedbat commented Apr 25, 2010

Can you provide me with a simple example?

@nedbat
Copy link
Owner Author

nedbat commented May 7, 2010

Original comment by Anonymous


Sorry about the delay... here it is: The problem doesn't occur with a doc-test file that is being run by doctest's basic API (such as doctest.testfile('readme.txt')). It does, however, occur when using the unittest API:

========================================================================

$ cat readme.txt
This is a doc test:

print 'foo'
foo

$ cat test.py
import doctest
import unittest

suite = doctest.DocFileSuite('readme.txt')
runner = unittest.TextTestRunner()
runner.run(suite)

$ coverage run test.py
.

Ran 1 test in 0.002s

OK

$ coverage annotate -i
Couldn't parse '/home/thomas/coverage/readme.txt' as Python source: 'invalid syntax' at line 1

========================================================================

In this case, the parse error occurs despite -i and no coverage reports are written.

@nedbat
Copy link
Owner Author

nedbat commented May 8, 2010

I fixed this in <<changeset 9ef11bf7e50d (bb)>> by not tracing the doctest file in the first place.

@nedbat nedbat closed this as completed May 8, 2010
@nedbat nedbat added major bug Something isn't working annotate labels Jun 23, 2018
agronholm pushed 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
annotate bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant