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

Add the dynamic_context setting to the sample coveragerc file #1934

Open
Mariatta opened this issue Mar 6, 2025 · 1 comment
Open

Add the dynamic_context setting to the sample coveragerc file #1934

Mariatta opened this issue Mar 6, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Mariatta
Copy link
Contributor

Mariatta commented Mar 6, 2025

Is your feature request related to a problem? Please describe.
Context measurement is a very useful feature, however I found that some projects do not have this setting in their coveragerc file.
As a result, I found myself needing to re-run the coverage again all over with this setting.

I think it would be great if this is a default setting in coveragerc file.

I was looking at the "SampleFile" section of the coveragerc documentation, and the sample does not include dynamic_context setting.

Describe the solution you'd like
Adding the line
[run]
dynamic_context = test_function
as an example in https://coverage.readthedocs.io/en/7.6.12/config.html#sample-file

Describe alternatives you've considered
I wish this is a default behavior.

Additional context
I think this is one of the most useful feature of coveragepy. More people should be using it.

I can create a PR if this ticket is approved.

@Mariatta Mariatta added the enhancement New feature or request label Mar 6, 2025
@nedbat
Copy link
Owner

nedbat commented Mar 6, 2025

I think most people won't want context measurement because of the time it adds and the bulk in the data. Though to be fair, I think most people don't know it even exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants