Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Lib/test/test_ctypes/test_pickling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand All @@ -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)
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_ctypes/test_refcounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
Loading