From 32858da8a6ec5fa746a8f62ed06cb47c818a4b77 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 19 Apr 2025 13:47:42 -0700 Subject: [PATCH] PYPY, GRAALPY: skip last part of test_weak_ptr_base --- tests/test_class_sh_trampoline_weak_ptr.py | 5 +++-- tests/test_class_sp_trampoline_weak_ptr.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_class_sh_trampoline_weak_ptr.py b/tests/test_class_sh_trampoline_weak_ptr.py index 741bb2804..c83b7fcfd 100644 --- a/tests/test_class_sh_trampoline_weak_ptr.py +++ b/tests/test_class_sh_trampoline_weak_ptr.py @@ -2,7 +2,7 @@ from __future__ import annotations import pytest -import env # noqa: F401 +import env import pybind11_tests.class_sh_trampoline_weak_ptr as m @@ -11,7 +11,6 @@ class PyDrvd(m.VirtBase): return 200 -@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC") @pytest.mark.parametrize(("vtype", "expected_code"), [(m.VirtBase, 100), (PyDrvd, 200)]) def test_weak_ptr_base(vtype, expected_code): wpo = m.WpOwner() @@ -27,4 +26,6 @@ def test_weak_ptr_base(vtype, expected_code): assert wpo.get_code() == -999 # THIS NEEDS FIXING (issue #5623) del obj + if env.PYPY or env.GRAALPY: + pytest.skip("Cannot reliably trigger GC") assert wpo.get_code() == -999 diff --git a/tests/test_class_sp_trampoline_weak_ptr.py b/tests/test_class_sp_trampoline_weak_ptr.py index 2fc36bac1..43db1b7d7 100644 --- a/tests/test_class_sp_trampoline_weak_ptr.py +++ b/tests/test_class_sp_trampoline_weak_ptr.py @@ -2,7 +2,7 @@ from __future__ import annotations import pytest -import env # noqa: F401 +import env import pybind11_tests.class_sp_trampoline_weak_ptr as m @@ -11,7 +11,6 @@ class PyDrvd(m.VirtBase): return 200 -@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC") @pytest.mark.parametrize(("vtype", "expected_code"), [(m.VirtBase, 100), (PyDrvd, 200)]) def test_weak_ptr_base(vtype, expected_code): wpo = m.WpOwner() @@ -24,4 +23,6 @@ def test_weak_ptr_base(vtype, expected_code): assert wpo.get_code() == expected_code del obj + if env.PYPY or env.GRAALPY: + pytest.skip("Cannot reliably trigger GC") assert wpo.get_code() == -999