Closed bersbersbers closed 1 month ago
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).
[tool.coverage.run]
omit = [
".venv/*",
# https://github.com/nedbat/coveragepy/issues/1392
"pyscript",
"shibokensupport/*",
"signature_bootstrap.py",
]
seems related to this: https://github.com/microsoft/vscode-python/issues/24366. Closing this one to group all the issues related to omitting from coverage in one issue.
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 https://github.com/microsoft/vscode-python/issues/24309#issuecomment-2413414716 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
.
"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
.Compare also https://github.com/microsoft/vscode-python/issues/24308.