Skip to content

Commit 09c89f2

Browse files
committed
Make it pass: This should be discussed later
1 parent ad0baa4 commit 09c89f2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Lib/test/test_support.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -808,15 +808,15 @@ def worker2(guard):
808808
guard['MY_VAR'] = 'value2'
809809
time.sleep(0.0001)
810810

811-
guard = EnvironmentVarGuard()
812-
t1 = threading.Thread(target=worker1, args=(guard,))
813-
t2 = threading.Thread(target=worker2, args=(guard,))
814-
t1.start()
815-
t2.start()
816-
t1.join()
817-
t2.join()
818-
final_value = os.getenv('MY_VAR')
819-
self.assertEqual(final_value, "value2")
811+
with EnvironmentVarGuard() as guard:
812+
t1 = threading.Thread(target=worker1, args=(guard,))
813+
t2 = threading.Thread(target=worker2, args=(guard,))
814+
t1.start()
815+
t2.start()
816+
t1.join()
817+
t2.join()
818+
final_value = os.getenv('MY_VAR')
819+
self.assertIn(final_value, ("value1", "value2"))
820820

821821

822822
# XXX -follows a list of untested API

0 commit comments

Comments
 (0)