block lines marked with 0 hits.

Issue #620 closed
Former user created an issue

i apologize in advance if this was covered before. i'm trying to understand why the method declaration is marked as hit but the subsequent lines are reported as not hit. in my coverage.xml i'm getting

<line hits="1" number="143"/>
<line hits="0" number="144"/>
<line hits="0" number="145"/>
<line hits="0" number="146"/>
<line hits="0" number="147"/>

where the line 143 is the method declaration and the other are simply statements:

def __init__(self, current_app, **kwargs):
        self.current_app = current_app
        self.name = kwargs.get('name', "")
        log.debug('Current App: %s', self.current_app)
        self.is_win = sys.platform == 'win32'

why does it happen? is there a way to get all the lines as hit?

Comments (5)

  1. Ned Batchelder repo owner

    This means that coverage was measuring during the importing of the file, but not during the running of the code. Perhaps you are spawning subprocesses? You'll need to provide more details to get better help :)

  2. Andres F Mosquera

    its a fork of pyupdater, this is the tox.ini used during the tests and this is the appveyor.yml

    it's running the tests on 4 parallel processes. is possible that not all tests results are being reported/combined?

  3. Ned Batchelder repo owner

    I'm not sure what the pytest-cov plugin does, especially with xdist. Maybe they can help untangle this?

  4. Log in to comment