https://github.com/python/cpython/commit/c22eef44d8b1d2828108b49a735359917ad1da79 commit: c22eef44d8b1d2828108b49a735359917ad1da79 branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: colesbury <colesb...@gmail.com> date: 2025-03-24T21:05:55Z summary:
[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 a1232459860235f4fb7896cc95966d87a51cbe32) Co-authored-by: Sam Gross <colesb...@gmail.com> files: M Lib/test/test_functools.py diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 544107e5a1c1e3..96001a943f0327 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1782,8 +1782,7 @@ def f(x): time.sleep(.01) return 3 * x def test(i, x): - with self.subTest(thread=i): - self.assertEqual(f(x), 3 * x, i) + self.assertEqual(f(x), 3 * x, i) threads = [threading.Thread(target=test, args=(i, v)) for i, v in enumerate([1, 2, 2, 3, 2])] with threading_helper.start_threads(threads): _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com