File tree Expand file tree Collapse file tree 7 files changed +24
-2
lines changed
Expand file tree Collapse file tree 7 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ def __init__(self):
190190 )
191191
192192
193+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
193194def test_return_none (capture ):
194195 n_inst = ConstructorStats .detail_reg_inst ()
195196 with capture :
@@ -217,6 +218,7 @@ def test_return_none(capture):
217218 assert capture == "Releasing parent."
218219
219220
221+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
220222def test_keep_alive_constructor (capture ):
221223 n_inst = ConstructorStats .detail_reg_inst ()
222224
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ def test_instance(msg):
2727
2828 instance = m .NoConstructor .new_instance ()
2929
30+ if env .GRAALPY :
31+ pytest .skip ("ConstructorStats is incompatible with GraalPy." )
32+
3033 cstats = ConstructorStats .get (m .NoConstructor )
3134 assert cstats .alive () == 1
3235 del instance
@@ -35,6 +38,10 @@ def test_instance(msg):
3538
3639def test_instance_new ():
3740 instance = m .NoConstructorNew () # .__new__(m.NoConstructor.__class__)
41+
42+ if env .GRAALPY :
43+ pytest .skip ("ConstructorStats is incompatible with GraalPy." )
44+
3845 cstats = ConstructorStats .get (m .NoConstructorNew )
3946 assert cstats .alive () == 1
4047 del instance
Original file line number Diff line number Diff line change 22
33import pytest
44
5+ import env # noqa: F401
56from pybind11_tests import copy_move_policies as m
67
78
@@ -17,6 +18,7 @@ def test_lacking_move_ctor():
1718 assert "is neither movable nor copyable!" in str (excinfo .value )
1819
1920
21+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
2022def test_move_and_copy_casts ():
2123 """Cast some values in C++ via custom type casters and count the number of moves/copies."""
2224
@@ -44,6 +46,7 @@ def test_move_and_copy_casts():
4446 assert c_m .alive () + c_mc .alive () + c_c .alive () == 0
4547
4648
49+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
4750def test_move_and_copy_loads ():
4851 """Call some functions that load arguments via custom type casters and count the number of
4952 moves/copies."""
@@ -77,6 +80,7 @@ def test_move_and_copy_loads():
7780
7881
7982@pytest .mark .skipif (not m .has_optional , reason = "no <optional>" )
83+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
8084def test_move_and_copy_load_optional ():
8185 """Tests move/copy loads of std::optional arguments"""
8286
Original file line number Diff line number Diff line change 22
33import pytest
44
5+ import env # noqa: F401
56from pybind11_tests import custom_type_casters as m
67
78
@@ -94,6 +95,7 @@ def test_noconvert_args(msg):
9495 )
9596
9697
98+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
9799def test_custom_caster_destruction ():
98100 """Tests that returning a pointer to a type that gets converted with a custom type caster gets
99101 destroyed when the function has py::return_value_policy::take_ownership policy applied.
Original file line number Diff line number Diff line change @@ -395,6 +395,7 @@ def test_eigen_return_references():
395395 np .testing .assert_array_equal (a_copy5 , c5want )
396396
397397
398+ @pytest .mark .skipif ("env.GRAALPY" , reason = "Cannot reliably trigger GC" )
398399def assert_keeps_alive (cl , method , * args ):
399400 cstats = ConstructorStats .get (cl )
400401 start_with = cstats .alive ()
Original file line number Diff line number Diff line change 22
33import pytest
44
5+ import env
56from pybind11_tests import ConstructorStats , UserType
67from pybind11_tests import opaque_types as m
78
@@ -30,7 +31,9 @@ def test_pointers(msg):
3031 living_before = ConstructorStats .get (UserType ).alive ()
3132 assert m .get_void_ptr_value (m .return_void_ptr ()) == 0x1234
3233 assert m .get_void_ptr_value (UserType ()) # Should also work for other C++ types
33- assert ConstructorStats .get (UserType ).alive () == living_before
34+
35+ if not env .GRAALPY :
36+ assert ConstructorStats .get (UserType ).alive () == living_before
3437
3538 with pytest .raises (TypeError ) as excinfo :
3639 m .get_void_ptr_value ([1 , 2 , 3 ]) # This should not work
Original file line number Diff line number Diff line change 22
33import pytest
44
5- import env # noqa: F401
5+ import env
66from pybind11_tests import ConstructorStats
77from pybind11_tests import operators as m
88
@@ -51,6 +51,9 @@ def test_operator_overloading():
5151 v2 /= v1
5252 assert str (v2 ) == "[2.000000, 8.000000]"
5353
54+ if env .GRAALPY :
55+ pytest .skip ("ConstructorStats is incompatible with GraalPy." )
56+
5457 cstats = ConstructorStats .get (m .Vector2 )
5558 assert cstats .alive () == 3
5659 del v1
You can’t perform that action at this time.
0 commit comments