Skip to content

feat(tests): Do not include type checking code in coverage report#3327

Merged
antonpirker merged 7 commits into
masterfrom
antonpirker/dont-count-types-in-coverage
Jul 23, 2024
Merged

feat(tests): Do not include type checking code in coverage report#3327
antonpirker merged 7 commits into
masterfrom
antonpirker/dont-count-types-in-coverage

Conversation

@antonpirker
Copy link
Copy Markdown
Contributor

This should not count lines (or rather if blocks) that start with if TYPE_CHECKING in the code coverage report, because this code is only evaluated when checking types with mypy.

@antonpirker antonpirker changed the title Do not type checking code in coverage report feat(tests): Do not type checking code in coverage report Jul 23, 2024
@antonpirker antonpirker changed the title feat(tests): Do not type checking code in coverage report feat(tests): Do not include type checking code in coverage report Jul 23, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.75%. Comparing base (25de71e) to head (27116d3).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3327      +/-   ##
==========================================
+ Coverage   79.49%   79.75%   +0.25%     
==========================================
  Files         133      133              
  Lines       14307    14285      -22     
  Branches     3009     3001       -8     
==========================================
+ Hits        11374    11393      +19     
+ Misses       2089     2070      -19     
+ Partials      844      822      -22     

see 26 files with indirect coverage changes

@antonpirker antonpirker marked this pull request as ready for review July 23, 2024 14:35
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Didn't know this was possible.

Comment thread .github/workflows/test-integrations-ai.yml
Comment thread pyproject.toml
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
] No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add newline at the end of the file here

Copy link
Copy Markdown
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change, I hope it helps us get more accurate coverage reports!

@antonpirker antonpirker merged commit 0812858 into master Jul 23, 2024
@antonpirker antonpirker deleted the antonpirker/dont-count-types-in-coverage branch July 23, 2024 14:55
arjennienhuis pushed a commit to arjennienhuis/sentry-python that referenced this pull request Sep 30, 2024
…tsentry#3327)

This should not count lines (or rather if blocks) that start with if TYPE_CHECKING in the code coverage report, because this code is only evaluated when checking types with mypy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants