[ez] Explicit env for run_test (#120251)

env=None (which is the default) inherits the env from the calling process.  Explicitly set the env to the calling process env so that things can be added to it later

Tested in: e7b4d8ec88
Checked that test-reports (which depend on the CI env var) get made.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/120251
Approved by: https://github.com/huydhn
This commit is contained in:
Catherine Lee 2024-02-21 00:40:19 +00:00 committed by PyTorch MergeBot
parent a1fc29cd78
commit af765dbdfd

View file

@ -384,6 +384,7 @@ def run_test(
extra_unittest_args=None,
env=None,
) -> int:
env = env or os.environ.copy()
maybe_set_hip_visible_devies()
unittest_args = options.additional_unittest_args.copy()
test_file = test_module.name