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

Support coverage.py dynamic contexts when coverage is being collected #97

Open
Julian opened this issue May 24, 2023 · 0 comments
Open

Comments

@Julian
Copy link

Julian commented May 24, 2023

coverage.py supports a notion of "dynamic contexts".

The most common reason for these is answering "what tests cover a particular line" in the coverage output -- but right now that information doesn't descend into subtests, so you just see one single context reported when looking at output.

E.g. here's a screenshot from a project where I'm running like 200 subtests within a single test (called test_referencing_suite), only a few of which are going to really cover this line, even though it gets reported as "1 ctx":

Screenshot 2023-05-24 at 14 17 44

I think the way to do this is by including a coverage plugin which is aware of when/how subtests are entered (and to conditionally call into it if coverage is being collected) though I haven't looked closely to be honest, figured I'd file this and see if there's any appetite first for even including this here.

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

No branches or pull requests

1 participant