annotate -i doesn't work

Issue #61 resolved
Thomas Lotze created an issue

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)

  1. Former user Account Deleted

    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'


    $ cat import doctest import unittest

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

    $ coverage run . ---------------------------------------------------------------------- Ran 1 test in 0.002s


    $ 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.

  2. Log in to comment