-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
[Bug] os.environ["USER"] is set unconditionally in hydra/hydra/test_utils/test_utils.py #1059
Comments
Relevant line: https://github.com/facebookresearch/hydra/blob/master/hydra/test_utils/test_utils.py#L30 Making a PR that checks if the variable is already set. |
Ideally we should unset the variable (if we do set it up). |
Can you provide a repro? I want to see why this is even being called for you. What are you doing that gets the USER overwritten? |
Simple test case to check the user. First pytest without extra options so hydra_pytest is enabled. Second test with hydra_pytest disabled on the command line
|
Gotcha. so as soon as Hydra is installed it overwrites the USER in pytest tests via the plugin. that's nasty and definitely unintended. |
Since os.environ["USER"] is set and hydra-core installs a pytest plugin any other pytest tests that use the $USER environment variable will get overridden to use "test_user" as the user. I think this should probably be a conditional check or something. We had a test start failing that was using $USER and it took some time to figure out why that was being set to test_user.
The text was updated successfully, but these errors were encountered: