1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #61 resolved

annotate -i doesn't work

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

  2. Log in to comment