mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-15 01:44:44 +00:00
Skip GC-dependent tests on GraalPy (#5401)
This commit is contained in:
parent
98ec25c6af
commit
cfd222ebdf
@ -11,7 +11,9 @@ if not m.defined_PYBIND11_SMART_HOLDER_ENABLED:
|
||||
pytest.skip("smart_holder not available.", allow_module_level=True)
|
||||
|
||||
|
||||
@pytest.mark.xfail("env.PYPY", reason="gc after `del field` is apparently deferred")
|
||||
@pytest.mark.skipif(
|
||||
"env.PYPY or env.GRAALPY", reason="gc after `del field` is apparently deferred"
|
||||
)
|
||||
@pytest.mark.parametrize("m_attr", ["m_valu_readonly", "m_valu_readwrite"])
|
||||
def test_valu_getter(m_attr):
|
||||
# Reduced from PyCLIF test:
|
||||
|
@ -212,10 +212,10 @@ def test_multiple_registered_instances_for_same_pointee_recursive():
|
||||
del obj_next
|
||||
assert obj.history == "PySft"
|
||||
del obj0
|
||||
if not env.PYPY:
|
||||
if not env.PYPY and not env.GRAALPY:
|
||||
assert obj0_wr() is not None
|
||||
del obj # This releases the chain recursively.
|
||||
if not env.PYPY:
|
||||
if not env.PYPY and not env.GRAALPY:
|
||||
assert obj0_wr() is None
|
||||
break # Comment out for manual leak checking (use `top` command).
|
||||
|
||||
|
@ -2,12 +2,14 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import env # noqa: F401
|
||||
import pybind11_tests.class_sh_trampoline_shared_ptr_cpp_arg as m
|
||||
|
||||
if not m.defined_PYBIND11_SMART_HOLDER_ENABLED:
|
||||
pytest.skip("smart_holder not available.", allow_module_level=True)
|
||||
|
||||
|
||||
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
|
||||
def test_shared_ptr_cpp_arg():
|
||||
import weakref
|
||||
|
||||
@ -32,6 +34,7 @@ def test_shared_ptr_cpp_arg():
|
||||
assert tester.get_object() is objref()
|
||||
|
||||
|
||||
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
|
||||
def test_shared_ptr_cpp_prop():
|
||||
class PyChild(m.SpBase):
|
||||
def is_base_used(self):
|
||||
@ -50,6 +53,7 @@ def test_shared_ptr_cpp_prop():
|
||||
assert tester.obj.has_python_instance() is True
|
||||
|
||||
|
||||
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
|
||||
def test_shared_ptr_arg_identity():
|
||||
import weakref
|
||||
|
||||
@ -68,6 +72,7 @@ def test_shared_ptr_arg_identity():
|
||||
assert tester.has_python_instance() is False
|
||||
|
||||
|
||||
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
|
||||
def test_shared_ptr_alias_nonpython():
|
||||
tester = m.SpBaseTester()
|
||||
|
||||
@ -110,6 +115,7 @@ def test_shared_ptr_alias_nonpython():
|
||||
assert new_tester.has_python_instance() is False
|
||||
|
||||
|
||||
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
|
||||
def test_shared_ptr_goaway():
|
||||
import weakref
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user