From ff1e6c1c31a14db65860fe968b4a82d4f313f2a1 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Fri, 18 Apr 2025 18:00:34 +0530 Subject: [PATCH] skip more tests --- Lib/test/test_ctypes/test_pickling.py | 4 ++-- Lib/test/test_ctypes/test_refcounts.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_ctypes/test_pickling.py b/Lib/test/test_ctypes/test_pickling.py index 9d433fc69de391..8f8c09f1fb6a43 100644 --- a/Lib/test/test_ctypes/test_pickling.py +++ b/Lib/test/test_ctypes/test_pickling.py @@ -3,7 +3,7 @@ from ctypes import (CDLL, Structure, CFUNCTYPE, pointer, c_void_p, c_char_p, c_wchar_p, c_char, c_wchar, c_int, c_double) -from test.support import import_helper +from test.support import import_helper, thread_unsafe _ctypes_test = import_helper.import_module("_ctypes_test") @@ -21,7 +21,6 @@ def __init__(self, *args, **kw): class Y(X): _fields_ = [("str", c_char_p)] - class PickleTest: def dumps(self, item): return pickle.dumps(item, self.proto) @@ -39,6 +38,7 @@ def test_simple(self): self.assertEqual(memoryview(src).tobytes(), memoryview(dst).tobytes()) + @thread_unsafe('not thread safe') def test_struct(self): X.init_called = 0 diff --git a/Lib/test/test_ctypes/test_refcounts.py b/Lib/test/test_ctypes/test_refcounts.py index 5f2f5c4a84d52e..1815649ceb5fff 100644 --- a/Lib/test/test_ctypes/test_refcounts.py +++ b/Lib/test/test_ctypes/test_refcounts.py @@ -3,7 +3,7 @@ import sys import unittest from test import support -from test.support import import_helper +from test.support import import_helper, thread_unsafe from test.support import script_helper _ctypes_test = import_helper.import_module("_ctypes_test") @@ -13,7 +13,7 @@ dll = ctypes.CDLL(_ctypes_test.__file__) - +@thread_unsafe('not thread safe') class RefcountTestCase(unittest.TestCase): @support.refcount_test def test_1(self): @@ -82,7 +82,7 @@ class X(ctypes.Structure): gc.collect() self.assertEqual(sys.getrefcount(func), orig_refcount) - +@thread_unsafe('not thread safe') class AnotherLeak(unittest.TestCase): def test_callback(self): proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int)