Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Lib/test/test_capi/test_mem.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re
import sys
import textwrap
import unittest


from test import support
from test.support import import_helper, requires_subprocess
from test.support.script_helper import assert_python_failure, assert_python_ok
Expand Down Expand Up @@ -75,12 +75,20 @@ def check_malloc_without_gil(self, code):
def test_pymem_malloc_without_gil(self):
# Debug hooks must raise an error if PyMem_Malloc() is called
# without holding the GIL
if support.check_sanitizer(thread=True) and sys.platform == 'darwin':
# See: gh-120696
raise unittest.SkipTest("this test will hang on macOS with TSAN")

code = 'import _testcapi; _testcapi.pymem_malloc_without_gil()'
self.check_malloc_without_gil(code)

def test_pyobject_malloc_without_gil(self):
# Debug hooks must raise an error if PyObject_Malloc() is called
# without holding the GIL
if support.check_sanitizer(thread=True) and sys.platform == 'darwin':
# See: gh-120696
raise unittest.SkipTest("this test will hang on macOS with TSAN")

code = 'import _testcapi; _testcapi.pyobject_malloc_without_gil()'
self.check_malloc_without_gil(code)

Expand Down