reset accelerate env variables after each test (#24107)

This commit is contained in:
Sourab Mangrulkar
2023-06-08 18:49:07 +05:30
committed by GitHub
parent 5fa0a1b23b
commit 0f23605094

View File

@@ -1339,6 +1339,11 @@ class TestCasePlus(unittest.TestCase):
AcceleratorState._reset_state()
PartialState._reset_state()
# delete all the env variables having `ACCELERATE` in them
for k in list(os.environ.keys()):
if "ACCELERATE" in k:
del os.environ[k]
def mockenv(**kwargs):
"""