From af765dbdfd9abb49ec2b8e3a5e095a0c9d56d952 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 21 Feb 2024 00:40:19 +0000 Subject: [PATCH] [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: https://hud.pytorch.org/pytorch/pytorch/commit/e7b4d8ec880c56883d684fcc05b6cdb20452aafb 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 --- test/run_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/run_test.py b/test/run_test.py index cb9de8a491d..33aed13db64 100755 --- a/test/run_test.py +++ b/test/run_test.py @@ -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