Skip to content

Commit

Permalink
gh-130095: Mark _py_abc tests as not thread-safe
Browse files Browse the repository at this point in the history
The `_py_abc` implementation is not currently thread-safe (even with the GIL).
Don't run these tests with `--parallel-threads=N` for now.
  • Loading branch information
colesbury committed Feb 14, 2025
1 parent e65e9f9 commit e880c6e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Lib/test/test_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,16 @@ class B(A, metaclass=abc_ABCMeta, name="test"):

return TestLegacyAPI, TestABC, TestABCWithInitSubclass

TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(abc.ABCMeta,
abc.get_cache_token)
TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(_py_abc.ABCMeta,
_py_abc.get_cache_token)
TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(_py_abc.ABCMeta,
_py_abc.get_cache_token)
TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(abc.ABCMeta,
abc.get_cache_token)

# gh-130095: The _py_abc tests are not thread-safe when run with
# `--parallel-threads`
TestLegacyAPI_Py.__unittest_thread_unsafe__ = True
TestABC_Py.__unittest_thread_unsafe__ = True
TestABCWithInitSubclass_Py.__unittest_thread_unsafe__ = True

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

0 comments on commit e880c6e

Please sign in to comment.