Add disable_block_exclusion Option #1764
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use case: I want coveragepy report the coverage of lines executed after Django has bootstrapped my application - this allows more accurate coverage reporting of things like class-based views, which always show 100% when the Django bootstrap process is included in the reporting. To do so, I've created a custom test runner in my project:
this works as expected, but (also, as expected), class / function definiton lines are not reported as being run, so when I exclude them (as well as import statements):
I run into the problem that their body defintions also get excluded per current functionality. I'v added the
disable_block_exclusion
option to the[report]
sectiont to allow for this functionality to be disabled.First time contributing, read through Contributing to coverage.py to try and include everything necessary here.
Open to any feedbabck from the configuration value's name to why you may not want to accept this change into your project - I would find it very useful though!