-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Set environment variable when coverage run is executed #771
Comments
Hmm, when I read the title, I thought, "You should have whatever is running coverage also set the environment variables." Maybe we can debug what went wrong when you tried to have tox set the variables? Can you share the details? |
The tox.ini is quite complex, though, the important bit is this. Our CI call was:
If it matters, this is our sitecustomize.py |
tox==3.7.0 |
Is this still an issue I can help with? |
No @nedbat, we can close it. Thanks for coverage! |
This was implemented in #553. |
Is your feature request related to a problem? Please describe.
I'd like my code to know that coverage is "calling the shots", ie,
coverage run -m <blah>
Describe the solution you'd like
My solution would be to set an environment variable when
coverage run -m <blah>
is executed, that way, my<blah>
"program" knows how its being executed.This allows my code to also inject in the environment, at runtime, for example
COVERAGE_PROCESS_START
, and also inject the path to a custom directory containingsiteconfig.py
so that coverage tracks my subprocesses.Describe alternatives you've considered
I tried setting up my tox file to set the
COVERAGE_PROCESS_START
variable, however, that solution does not work well for both *Nix and Windows.Maybe a
os.path.normpath()
would fix the above exception, but I'd still like to know thatcoverage run
was used...The text was updated successfully, but these errors were encountered: