tests: cleanup and ci hardening (#2397)
* tests: refactor and cleanup
* refactor: more consistent
* tests: vendor six
* tests: more xfails, nicer system
* tests: simplify to info
* tests: suggestions from @YannickJadoul and @bstaletic
* tests: restore some pypy tests that now pass
* tests: rename info to env
* tests: strict False/True
* tests: drop explicit strict=True again
* tests: reduce minimum PyTest to 3.1
diff --git a/tests/test_call_policies.py b/tests/test_call_policies.py
index 0e3230c..ec005c1 100644
--- a/tests/test_call_policies.py
+++ b/tests/test_call_policies.py
@@ -1,9 +1,13 @@
# -*- coding: utf-8 -*-
import pytest
+
+import env # noqa: F401
+
from pybind11_tests import call_policies as m
from pybind11_tests import ConstructorStats
+@pytest.mark.xfail("env.PYPY", reason="sometimes comes out 1 off on PyPy", strict=False)
def test_keep_alive_argument(capture):
n_inst = ConstructorStats.detail_reg_inst()
with capture:
@@ -70,8 +74,8 @@
"""
-# https://bitbucket.org/pypy/pypy/issues/2447
-@pytest.unsupported_on_pypy
+# https://foss.heptapod.net/pypy/pypy/-/issues/2447
+@pytest.mark.xfail("env.PYPY", reason="_PyObject_GetDictPtr is unimplemented")
def test_alive_gc(capture):
n_inst = ConstructorStats.detail_reg_inst()
p = m.ParentGC()