annotate -i doesn't work
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.
Comments (3)
-
-
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.
-
- changed status to resolved
I fixed this in 9ef11bf7e50d by not tracing the doctest file in the first place.
- Log in to comment
Can you provide me with a simple example?