This repository was archived by the owner on May 21, 2025. It is now read-only.
This repository was archived by the owner on May 21, 2025. It is now read-only.
Description
Initial setup
I have a .coveragerc file like:
[report]
exclude_lines =
def __repr__
I run my tests with tox which in turn runs pytest with pytest-cov, which means my tox.ini file looks like this:
[testenv]
deps =
pytest
pytest-cov
commands = pytest --cov
Then:
- When running tox in my machine the showed report correctly excludes those lines.
- When the CI service runs tox, it also shows the correct report, with those lines excluded.
- Just after running tox, the CI service runs codecov and the report uploaded to Codecov is also correct.
Broken setup
Now I remove .coveragerc file and move those lines to tox.ini:
[coverage:report]
exclude_lines =
def __repr__
Then:
- When running tox in my machine the showed report correctly excludes those lines.
- When the CI service runs tox, it also shows the correct report, with those lines excluded.
- Just after running tox, the CI service runs codecov and the report uploaded to Codecov, this time, differs. It does not have those excluded lines, so they are reported as not covered.
Questions
- Why is this happening?
- Is there any way I could fix that?
- Is there an option in codecov to specify the coverage configuration is in tox.ini
- Should not codecov read that file by default?
Reactions are currently unavailable
Initial setup
I have a .coveragerc file like:
[report] exclude_lines = def __repr__I run my tests with tox which in turn runs pytest with pytest-cov, which means my tox.ini file looks like this:
[testenv] deps = pytest pytest-cov commands = pytest --covThen:
Broken setup
Now I remove .coveragerc file and move those lines to tox.ini:
[coverage:report] exclude_lines = def __repr__Then:
Questions