Skip to content

Prevent lines containing ... being excluded from coverage #3298

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

Merged
merged 2 commits into from
Jul 25, 2025

Conversation

K-Meech
Copy link
Contributor

@K-Meech K-Meech commented Jul 25, 2025

For #3297

This PR prevents lines that contain ... (alongside other text) from being excluded from coverage - see the corresponding issue #3297 for more details.

I swapped from exclude_lines to exclude_also, as this allows the default exclusions to be kept + added to, rather than completely overwritten (see coverage docs). Since coverage version 7.10.0 the default exclusions have included lines with ... by itself.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.rst
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jul 25, 2025
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"pragma: ${PY_MAJOR_VERSION} no cover",
Copy link
Contributor

Choose a reason for hiding this comment

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

is the pragma: no cover directive handled automatically with the new version of coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - it's listed in the default exclusions. I also checked locally, and lines tagged with # pragma: no cover seemed to be excluded correctly.

Copy link

codecov bot commented Jul 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.68%. Comparing base (01751d6) to head (9dfbae2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3298      +/-   ##
==========================================
+ Coverage   59.69%   60.68%   +0.99%     
==========================================
  Files          78       78              
  Lines        8694     9356     +662     
==========================================
+ Hits         5190     5678     +488     
- Misses       3504     3678     +174     

see 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b
Copy link
Contributor

d-v-b commented Jul 25, 2025

thanks @K-Meech!

@d-v-b d-v-b enabled auto-merge (squash) July 25, 2025 11:56
@d-v-b d-v-b merged commit a0c56fb into zarr-developers:main Jul 25, 2025
29 checks passed
@K-Meech K-Meech deleted the km/coverage-exclude branch July 25, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release notes Automatically applied to PRs which haven't added release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy