Skip to content

Commit c22eef4

Browse files
[3.13] gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) (gh-131692)
The call to `with self.subTest(...)` was not thread-safe. (cherry picked from commit a123245) Co-authored-by: Sam Gross <[email protected]>
1 parent 3492098 commit c22eef4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/test/test_functools.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1782,8 +1782,7 @@ def f(x):
17821782
time.sleep(.01)
17831783
return 3 * x
17841784
def test(i, x):
1785-
with self.subTest(thread=i):
1786-
self.assertEqual(f(x), 3 * x, i)
1785+
self.assertEqual(f(x), 3 * x, i)
17871786
threads = [threading.Thread(target=test, args=(i, v))
17881787
for i, v in enumerate([1, 2, 2, 3, 2])]
17891788
with threading_helper.start_threads(threads):

0 commit comments

Comments
 (0)