# pragma: no cover is still being covered

Description

Code coverage failed from 100% to 37% because CodeCov is still covering “#pragma: no cover”. Example can be found here: Codecov

Manually running tests locally and generating HTML report shows it is 100% covered.

Repository

Steps to Reproduce

Just check the CodeCov reports

Expected behavior: Should have 100% coverage

Actual behavior: Only have 37% coverage

Flakiness? Just right now

Versions

Tests are ran in Linux, OSX, and Windows in all Python versions using Travis and AppVeyor.

Additional Information

None

Hi @roniemartinez

We don’t look at your source files at all, only the reports.

Since that file is included in your uploaded report
<class branch-rate="0" complexity="0" filename="amortize.py" line-rate="1" name="amortize.py">

We assume it needs to be covered, look at the empty lines object below, and mark it as a zero-percent covered file. If you you can report this file from your coverage report, the coverage will be as you expect.

We don’t look at your source files at all, only the reports.

Then your reporting is incorrect. Look at the line-rate… 1 means 100% coverage.

Edit: If you look at the <coverage> tag 14 lines covered out of 14 valid (100%)

<coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="1" lines-covered="14" lines-valid="14" timestamp="1583780714089" version="4.4.2">

Hi @roniemartinez, I noticed there hasn’t been much activity on that repository lately, but coverage is back at 100%. Is this still an issue for you?

Hi @tom

Yeah it’s back to normal again. But there were no report what was fixed and my code coverage looked weird with that big drop. I believe that graph should have also been fixed.

Nope, they were not really fixed. As seen on Excluding lines with exclude_lines in .coveragerc does not work for me · Issue #107 · codecov/codecov-python · GitHub if you happen to configure coveragepy using pyproject.toml (recommended file), it will not work and there is no workaround, because codecov own config does not have an option to override it.