Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions src/c/test_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -3288,6 +3288,7 @@ class mylist(list):
pytest.raises(RuntimeError, from_handle, cast(BCharP, 0))

def test_new_handle_cycle():
import gc
import _weakref
BVoidP = new_pointer_type(new_void_type())
class A(object):
Expand All @@ -3296,9 +3297,9 @@ class A(object):
o.cycle = newp_handle(BVoidP, o)
wr = _weakref.ref(o)
del o
for i in range(3):
if wr() is not None:
import gc; gc.collect()
# free-threading requires more iterations to clear weakref
while wr() is not None:
gc.collect()
assert wr() is None

def _test_bitfield_details(flag):
Expand Down
1 change: 1 addition & 0 deletions testing/cffi1/test_ffi_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_ffi_cache_type():
assert ffi.typeof("int[][10]") is ffi.typeof("int[][10]")
assert ffi.typeof("int(*)()") is ffi.typeof("int(*)()")

@pytest.mark.thread_unsafe
def test_ffi_type_not_immortal():
import weakref, gc
ffi = _cffi1_backend.FFI()
Expand Down
3 changes: 2 additions & 1 deletion testing/cffi1/test_pkgconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_merge_flags():
"bar" : ["b", "a", "z"],
"foo" : []}


@pytest.mark.thread_unsafe
def test_pkgconfig():
assert pkgconfig.flags_from_pkgconfig([]) == {}

Expand Down Expand Up @@ -56,6 +56,7 @@ def communicate(self):
self.returncode = rc
return bout, berr

@pytest.mark.thread_unsafe
def test_call():
saved = pkgconfig.subprocess
try:
Expand Down
3 changes: 3 additions & 0 deletions testing/cffi1/test_re_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def test_include_1():
p = ffi.new("bar_t *", [5, b"foobar"])
assert p.a[4] == ord('a')

@pytest.mark.thread_unsafe
def test_global_var():
from re_python_pysrc import ffi
lib = ffi.dlopen(extmod)
Expand Down Expand Up @@ -238,6 +239,7 @@ def test_partial_enum():
pytest.raises(VerificationMissing, ffi.emit_python_code,
str(tmpdir.join('test_partial_enum.py')))

@pytest.mark.thread_unsafe
def test_anonymous_union_inside_struct():
# based on issue #357
from re_python_pysrc import ffi
Expand All @@ -262,6 +264,7 @@ def test_anonymous_union_inside_struct():
assert ffi.offsetof("struct NVGcolor", "b") == FLOAT * 2
assert ffi.offsetof("struct NVGcolor", "a") == FLOAT * 3

@pytest.mark.thread_unsafe
def test_selfref():
# based on issue #429
from re_python_pysrc import ffi
Expand Down
2 changes: 1 addition & 1 deletion testing/embedding/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def copy_away_env():
except NameError:
org_env = os.environ.copy()


@pytest.mark.thread_unsafe
class EmbeddingTests:
_compiled_modules = {}

Expand Down
Loading