22
33import pytest
44
5+ import env # noqa: F401
56import pybind11_tests .class_sh_trampoline_shared_ptr_cpp_arg as m
67
78if not m .defined_PYBIND11_SMART_HOLDER_ENABLED :
89 pytest .skip ("smart_holder not available." , allow_module_level = True )
910
1011
12+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
1113def test_shared_ptr_cpp_arg ():
1214 import weakref
1315
@@ -32,6 +34,7 @@ def is_base_used(self):
3234 assert tester .get_object () is objref ()
3335
3436
37+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
3538def test_shared_ptr_cpp_prop ():
3639 class PyChild (m .SpBase ):
3740 def is_base_used (self ):
@@ -50,6 +53,7 @@ def is_base_used(self):
5053 assert tester .obj .has_python_instance () is True
5154
5255
56+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
5357def test_shared_ptr_arg_identity ():
5458 import weakref
5559
@@ -68,6 +72,7 @@ def test_shared_ptr_arg_identity():
6872 assert tester .has_python_instance () is False
6973
7074
75+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
7176def test_shared_ptr_alias_nonpython ():
7277 tester = m .SpBaseTester ()
7378
@@ -110,6 +115,7 @@ def test_shared_ptr_alias_nonpython():
110115 assert new_tester .has_python_instance () is False
111116
112117
118+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
113119def test_shared_ptr_goaway ():
114120 import weakref
115121
0 commit comments