Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid computing coverage over TYPE_CHECKING block #495

Closed
7 tasks done
redeboer opened this issue Jan 17, 2025 · 0 comments · Fixed by #497
Closed
7 tasks done

Avoid computing coverage over TYPE_CHECKING block #495

redeboer opened this issue Jan 17, 2025 · 0 comments · Fixed by #497
Assignees
Labels
⚙️ Enhancement Improvements and optimizations of existing features
Milestone

Comments

@redeboer
Copy link
Member

redeboer commented Jan 17, 2025

By setting configuring coverage in pyproject.toml with exclude_also, coverage becomes more accurate. In this case like so:

[tool.coverage.report]
exclude_also = [
    "if TYPE_CHECKING:",
]

Implementation PRs

Preview Give feedback
  1. ⚙️ Enhancement
    redeboer
  2. 🐛 Bug 🔨 Maintenance 🖱️ DX
    grayson-helmholz
  3. 🔨 Maintenance 🖱️ DX
    grayson-helmholz
  4. 🔨 Maintenance 🖱️ DX
    grayson-helmholz
  5. 🔨 Maintenance 🖱️ DX
    redeboer
  6. 🔨 Maintenance 🖱️ DX
    redeboer
  7. 🔨 Maintenance 🖱️ DX
    grayson-helmholz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Enhancement Improvements and optimizations of existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant