pybind11/tests/test_unnamed_namespace_a.py
Ralf W. Grosse-Kunstleve b7c33009ac
Start pybind11v3: Remove all code for PYBIND11_INTERNALS_VERSIONs 4 and 5 (#5530)
* Start pybind11v3

* Remove all code for PYBIND11_INTERNALS_VERSION 4 and 5

* Fix oversight: pybind11/_version.py needs to be updated as well.

* Add @pytest.mark.skipif("env.GRAALPY", reason="TODO debug segfault")
2025-02-19 09:24:02 -08:00

31 lines
1007 B
Python

from __future__ import annotations
import pytest
from pybind11_tests import unnamed_namespace_a as m
from pybind11_tests import unnamed_namespace_b as mb
XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)"
XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319"
@pytest.mark.xfail(XFAIL_CONDITION, reason=XFAIL_REASON, strict=False)
@pytest.mark.parametrize(
"any_struct", [m.unnamed_namespace_a_any_struct, mb.unnamed_namespace_b_any_struct]
)
def test_have_class_any_struct(any_struct):
assert any_struct is not None
def test_have_at_least_one_class_any_struct():
assert (
m.unnamed_namespace_a_any_struct is not None
or mb.unnamed_namespace_b_any_struct is not None
)
@pytest.mark.xfail(XFAIL_CONDITION, reason=XFAIL_REASON, strict=True)
def test_have_both_class_any_struct():
assert m.unnamed_namespace_a_any_struct is not None
assert mb.unnamed_namespace_b_any_struct is not None