10000 gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) · python/cpython@a123245 · GitHub
[go: up one dir, main page]

Skip to content

Commit a123245

Browse files
authored
gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679)
The call to `with self.subTest(...)` was not thread-safe.
1 parent 7c3692f commit a123245

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/test/test_functools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,8 +1934,7 @@ def f(x):
19341934
time.sleep(.01)
19351935
return 3 * x
19361936
def test(i, x):
1937-
with self.subTest(thread=i):
1938-
self.assertEqual(f(x), 3 * x, i)
1937+
self.assertEqual(f(x), 3 * x, i)
19391938
threads = [threading.Thread(target=test, args=(i, v))
19401939
for i, v in enumerate([1, 2, 2, 3, 2])]
19411940
with threading_helper.start_threads(threads):

0 commit comments

Comments
 (0)
0