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
I use coverage contexts mainly to distinguish coverage from different tox environments with different python version and sometimes different libraries versions.
coverage.py allows it by adding --context {envname} in tox.ini.
On the other hand, pytest-cov only support dynamic contexts with --cov-context=test.
It would be useful if pytest-cov allowed to set static context name through CLI options.
Activity
webknjaz commentedon Apr 21, 2025
Try setting it in
.coveragerctkukushkin commentedon Apr 21, 2025
As far as I understand I can't because it depends on a tox environment name.
tkukushkin commentedon Apr 22, 2025
I found a solution: coverage-py supports environment variable substitution in its config.
So I added the following to .coveragerc:
and to tox.ini:
It works as expected. Thank you for your idea.
webknjaz commentedon Apr 22, 2025
Ah, I didn't know it resolves env vars.