Skip to content

Commit 39cd972

Browse files
authored
gh-130095: Mark _py_abc tests as not thread-safe (gh-130131)
The `_py_abc` implementation is not currently thread-safe (even with the GIL). Don't run these tests with `--parallel-threads=N` for now.
1 parent 5a586c3 commit 39cd972

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Lib/test/test_abc.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,16 @@ class B(A, metaclass=abc_ABCMeta, name="test"):
684684

685685
return TestLegacyAPI, TestABC, TestABCWithInitSubclass
686686

687-
TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(abc.ABCMeta,
688-
abc.get_cache_token)
689-
TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(_py_abc.ABCMeta,
690-
_py_abc.get_cache_token)
687+
TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(_py_abc.ABCMeta,
688+
_py_abc.get_cache_token)
689+
TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(abc.ABCMeta,
690+
abc.get_cache_token)
691+
692+
# gh-130095: The _py_abc tests are not thread-safe when run with
693+
# `--parallel-threads`
694+
TestLegacyAPI_Py.__unittest_thread_unsafe__ = True
695+
TestABC_Py.__unittest_thread_unsafe__ = True
696+
TestABCWithInitSubclass_Py.__unittest_thread_unsafe__ = True
691697

692698
if __name__ == "__main__":
693699
unittest.main()

0 commit comments

Comments
 (0)