Skip to content

Differences in coverage percentage between Python 3.7 and Python 3.8 #866

@callmesangio

Description

@callmesangio

Describe the bug
The coverage percentage appears to be sensible to the Python version under which coverage run and coverage combine + coverage report are executed. Specifically, the coverage percentage varies depending on the combinations of Python versions those commands are run with (while using the same version of coverage.py).

I have experienced the following patterns:

coverage run coverage combine + coverage report coverage percentage
Python 3.7 Python 3.7 100%
Python 3.8 Python 3.8 100%
Python 3.7 Python 3.8 92%
Python 3.8 Python 3.7 100%

To Reproduce

  • Clone this repository: https://github.com/sanjioh/tox-interpreters.
  • Run tox -r -e py38-tox314,coverage-report. This should report a 100% coverage.
  • Run tox -r -e py37-tox314,coverage-report. This should report a 92% coverage.
  • If basepython for the coverage-report tox env is changed to python3.7, coverage consistently reports 100%, as per the above table.

coverage.py version: 4.5.4

Expected behavior
I would expect to get 100% coverage for the combination of coverage run run with Python 3.7, coverage combine + coverage report run with Python 3.8.

Thanks for your support, please let me know if you need any further information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions