Allow excluding region reporting in all report types that support it by astei · Pull Request #2135 · coveragepy/coveragepy · GitHub
Skip to content

Allow excluding region reporting in all report types that support it#2135

Open
astei wants to merge 1 commit into
coveragepy:mainfrom
astei:astei/skip-regions-json
Open

Allow excluding region reporting in all report types that support it#2135
astei wants to merge 1 commit into
coveragepy:mainfrom
astei:astei/skip-regions-json

Conversation

@astei

@astei astei commented Feb 18, 2026

Copy link
Copy Markdown

This PR adds a new flag, --omit-regions, to the JSON and HTML reports.

I use coverage.py on a particularly large monolithic application (several millions of lines of code), and we have custom tooling that parses JSON reports created by coverage.py. When region-level reporting was added to JSON reports, this tooling had a notable regression in memory usage and performance. We don't use this information, so it's helpful if coverage.py doesn't emit it in the first place.

Comment thread tests/test_json.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems unrelated to your goals, does it become necessary due to the other changes?

@astei astei Feb 18, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, the tests did not pass because of float representation being inexact, despite not changing the code that was being covered.

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.

2 participants