3

When running pytest with python -m pytest --cov=. --cov-report html:coverage

After the coverage report is generated my tests show up in the code coverage report as being 100% covered as shown below

codecov

I've attempted to move tests into its own folder, but still yields the same results

The actual unit tests should not show up in the coverage report and are skewing my coverage amount. It should only show coverage for the actual program.

clbx
  • 154
  • 2
  • 15

1 Answers1

3

As mentioned in this SO answer, creating a .coveragerc and adding

[run]
omit = 
    */test*

solves this issue.

Blairg23
  • 11,334
  • 6
  • 72
  • 72
clbx
  • 154
  • 2
  • 15