You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Run Test with Coverage" should allow omitting files from the report #24309
"Run Test with Coverage" should allow omitting files from the report. Ideally, honor the "omit" setting in the coverage configuration. Some default arguments may be set, such as .venv.
It seems this can be done using a workaround, namely, by using tool.coverage.run.omit (as opposed to tool.coverage.report.omit, which I tried previously).
Just for the record: this is a different issue than #24308 IMHO, related to the fact that omission of files can happen in at least two different places.
In this issue, I don't really care which mechanism is used, as long as the files do not appear in the final report in the UI. In fact, the workaround mentioned in #24309 (comment) works fine for me. So I am fine with closing this issue.
Just for completeness, in #24308, I care about error handling during the reporting phase, in case a file that exiting during run is missing during report.
Hi! I have tried this with both argument types in both .coveragerc and pyproject.toml and both work. Closing as I was unable to repro and looks like this is supported
Activity
bersbersbers commentedon Oct 15, 2024
It seems this can be done using a workaround, namely, by using
tool.coverage.run.omit(as opposed totool.coverage.report.omit, which I tried previously).eleanorjboyd commentedon Oct 30, 2024
seems related to this: #24366. Closing this one to group all the issues related to omitting from coverage in one issue.
bersbersbers commentedon Oct 31, 2024
Just for the record: this is a different issue than #24308 IMHO, related to the fact that omission of files can happen in at least two different places.
coverage.run.omit, https://coverage.readthedocs.io/en/latest/config.html#run-omit)coverage.report.omit, https://coverage.readthedocs.io/en/latest/config.html#report-omit)In this issue, I don't really care which mechanism is used, as long as the files do not appear in the final report in the UI. In fact, the workaround mentioned in #24309 (comment) works fine for me. So I am fine with closing this issue.
Just for completeness, in #24308, I care about error handling during the reporting phase, in case a file that exiting during
runis missing duringreport.eleanorjboyd commentedon Sep 16, 2025
Hi! I have tried this with both argument types in both
.coveragercandpyproject.tomland both work. Closing as I was unable to repro and looks like this is supported