Pypy testing no longer xfails (#6077)
* test passes on PyPy macOS
* adjust tests for pypy HEAD
* fixes from review
* pypy 7.3.23 was released, drop some PyPy testing
* pin to pypy version 7.3.23
* Restore xfail for cross-module translator platforms
Keep the expected failure for Android and FreeBSD while limiting the PyPy-specific part to versions before 7.3.23. Android CIBW still raises RuntimeError for this test, matching the existing tracked platform issue.
---------
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8a4e971..64b6804 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -48,8 +48,7 @@
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON
- runs-on: ubuntu-latest
- # Temporarily pinned pending investigation in issue #6049.
- python-version: 'pypy-3.11-v7.3.21'
+ python-version: 'pypy-3.11-v7.3.23'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: ubuntu-latest
python-version: 'graalpy-24.2'
@@ -94,7 +93,7 @@
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: ubuntu-latest
- python-version: 'pypy-3.10'
+ python-version: 'pypy-3.11-v7.3.23'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: ubuntu-latest
python-version: 'graalpy-24.1'
@@ -115,12 +114,8 @@
- runs-on: macos-latest
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=20
- - runs-on: macos-15-intel
- python-version: 'pypy-3.10'
- cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: macos-latest
- # Temporarily pinned pending investigation in issue #6049.
- python-version: 'pypy-3.11-v7.3.21'
+ python-version: 'pypy-3.11-v7.3.23'
- runs-on: macos-latest
python-version: 'graalpy-24.2'
@@ -150,11 +145,7 @@
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=23
- runs-on: windows-latest
- python-version: 'pypy-3.10'
- cmake-args: -DCMAKE_CXX_STANDARD=17
- - runs-on: windows-latest
- # Temporarily pinned pending investigation in issue #6049.
- python-version: 'pypy3.11-v7.3.21'
+ python-version: 'pypy3.11'
cmake-args: -DCMAKE_CXX_STANDARD=20
# The setup-python action currently doesn't have graalpy for windows
# See https://github.com/actions/setup-python/pull/880
diff --git a/tests/env.py b/tests/env.py
index 12acde7..23995c2 100644
--- a/tests/env.py
+++ b/tests/env.py
@@ -27,6 +27,7 @@
CPYTHON = platform.python_implementation() == "CPython"
PYPY = platform.python_implementation() == "PyPy"
+PYPY_PRE_7_3_23 = PYPY and sys.pypy_version_info < (7, 3, 23)
GRAALPY = sys.implementation.name == "graalpy"
_graalpy_version = (
sys.modules["__graalpython__"].get_graalvm_version() if GRAALPY else "0.0.0"
diff --git a/tests/test_class_sh_disowning_mi.py b/tests/test_class_sh_disowning_mi.py
index 4a4beec..fbca867 100644
--- a/tests/test_class_sh_disowning_mi.py
+++ b/tests/test_class_sh_disowning_mi.py
@@ -145,7 +145,7 @@
MI6.__init__(self, i)
-@pytest.mark.xfail("env.PYPY")
+@pytest.mark.xfail("env.PYPY_PRE_7_3_23")
def test_multiple_inheritance_python():
# Based on test_multiple_inheritance.py:test_multiple_inheritance_python.
# Exercises values_and_holders with 2 value_and_holder instances.
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index 59845b4..e6441f6 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -74,12 +74,10 @@
assert str(excinfo.value) == "'just local'"
-# TODO: FIXME
@pytest.mark.xfail(
- "(env.MACOS and env.PYPY) or env.ANDROID or env.FREEBSD",
+ "(env.MACOS and env.PYPY_PRE_7_3_23) or env.ANDROID or env.FREEBSD",
raises=RuntimeError,
reason="See Issue #2847, PR #2999, PR #4324, PR #5925",
- strict=not env.PYPY, # PR 5569
)
def test_cross_module_exception_translator():
with pytest.raises(KeyError):
diff --git a/tests/test_multiple_inheritance.py b/tests/test_multiple_inheritance.py
index c127036..e413d32 100644
--- a/tests/test_multiple_inheritance.py
+++ b/tests/test_multiple_inheritance.py
@@ -14,7 +14,7 @@
assert mt.bar() == 4
-@pytest.mark.xfail("env.PYPY")
+@pytest.mark.xfail("env.PYPY_PRE_7_3_23")
def test_multiple_inheritance_mix1():
class Base1:
def __init__(self, i):
@@ -53,7 +53,7 @@
assert mt.bar() == 4
-@pytest.mark.xfail("env.PYPY")
+@pytest.mark.xfail("env.PYPY_PRE_7_3_23")
def test_multiple_inheritance_python():
class MI1(m.Base1, m.Base2):
def __init__(self, i, j):