Skip to content

Code coverage report seems wrong on 3.8 #409

@P403n1x87

Description

@P403n1x87

Summary

Running the same tests with nox against Python 3.6, 3.7 and 3.8 shows wrong report being generated for Python 3.8. This seems to be caused by the fact that the number of reported lines for some sources is wrong.

Expected vs actual result

The report generated with Python 3.6 seems fine:

----------- coverage: platform linux, python 3.6.9-final-0 -----------
Name                          Stmts   Miss  Cover   Missing
-----------------------------------------------------------
austin/__init__.py               60     15    75%   86-87, 92-99, 114, 122, 134, 155, 165, 182
austin/aio.py                    32      2    94%   84, 107
austin/cli.py                    63      2    97%   160, 171
austin/format/__init__.py         0      0   100%
austin/format/speedscope.py      75     17    77%   112, 119, 160-197, 201
austin/simple.py                 29      2    93%   72, 93
austin/stats.py                 122      3    98%   223, 255, 273
austin/threads.py                17      2    88%   81, 93
-----------------------------------------------------------
TOTAL                           398     43    89%

This is what the same tests produce with Python 3.8

----------- coverage: platform linux, python 3.8.3-final-0 -----------
Name                          Stmts   Miss  Cover   Missing
-----------------------------------------------------------
austin/__init__.py               74     42    43%   86-87, 92-122, 134, 155-1447
austin/aio.py                    44     35    20%   329-1657
austin/cli.py                   126     93    26%   160-171, 306-2957
austin/format/__init__.py         0      0   100%
austin/format/speedscope.py     113     71    37%   160-1477
austin/simple.py                 34     25    26%   319-866
austin/stats.py                 132      9    93%   223, 255, 273, 329-691
austin/threads.py                17      2    88%   81, 93
-----------------------------------------------------------
TOTAL                           540    277    49%

Note how some sources in the 3.8 case are reported to be ridiculously larger than in the 3.6 case.

Reproducer

It seems to happen with every test run.

Versions

pytest (5.4.2)
pytest-cov (2.9.0)
nox (2020.5.24)

Config

Please ask me in a comment if you need anything in particular.

Code

Currently from a private repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions