aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/conftest.py
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
committergatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
commita72f898ff4c4237424c468044a6db9d6953b541e (patch)
tree1c4a543f661dd1b281aecf4660388491702fa8d8 /3rdparty/pybind11/tests/conftest.py
parentf1349e114f3a16ccd002e8513339e18f5be4d31b (diff)
downloadnextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.gz
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.bz2
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.zip
3rdparty: Bump vendored pybind11 version for py3.11 support
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to '3rdparty/pybind11/tests/conftest.py')
-rw-r--r--3rdparty/pybind11/tests/conftest.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/3rdparty/pybind11/tests/conftest.py b/3rdparty/pybind11/tests/conftest.py
index 362eb806..02ce263a 100644
--- a/3rdparty/pybind11/tests/conftest.py
+++ b/3rdparty/pybind11/tests/conftest.py
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
"""pytest configuration
Extends output capture as needed by pybind11: ignore constructors, optional unordered lines.
-Adds docstring and exceptions message sanitizers: ignore Python 2 vs 3 differences.
+Adds docstring and exceptions message sanitizers.
"""
import contextlib
@@ -13,19 +12,14 @@ import textwrap
import pytest
-import env
-
# Early diagnostic for failed imports
-import pybind11_tests # noqa: F401
+import pybind11_tests
-_unicode_marker = re.compile(r"u(\'[^\']*\')")
_long_marker = re.compile(r"([0-9])L")
_hexadecimal = re.compile(r"0x[0-9a-fA-F]+")
# Avoid collecting Python3 only files
collect_ignore = []
-if env.PY2:
- collect_ignore.append("test_async.py")
def _strip_and_dedent(s):
@@ -45,7 +39,7 @@ def _make_explanation(a, b):
]
-class Output(object):
+class Output:
"""Basic output post-processing and comparison"""
def __init__(self, string):
@@ -83,7 +77,7 @@ class Unordered(Output):
return False
-class Capture(object):
+class Capture:
def __init__(self, capfd):
self.capfd = capfd
self.out = ""
@@ -126,7 +120,7 @@ def capture(capsys):
return Capture(capsys)
-class SanitizedString(object):
+class SanitizedString:
def __init__(self, sanitizer):
self.sanitizer = sanitizer
self.string = ""
@@ -149,9 +143,7 @@ class SanitizedString(object):
def _sanitize_general(s):
s = s.strip()
s = s.replace("pybind11_tests.", "m.")
- s = s.replace("unicode", "str")
s = _long_marker.sub(r"\1", s)
- s = _unicode_marker.sub(r"\1", s)
return s
@@ -206,3 +198,16 @@ def gc_collect():
def pytest_configure():
pytest.suppress = suppress
pytest.gc_collect = gc_collect
+
+
+def pytest_report_header(config):
+ del config # Unused.
+ assert (
+ pybind11_tests.compiler_info is not None
+ ), "Please update pybind11_tests.cpp if this assert fails."
+ return (
+ "C++ Info:"
+ f" {pybind11_tests.compiler_info}"
+ f" {pybind11_tests.cpp_std}"
+ f" {pybind11_tests.PYBIND11_INTERNALS_ID}"
+ )