diff options
author | myrtle <gatecat@ds0.me> | 2022-09-15 09:06:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-15 09:06:35 +0200 |
commit | 3983d4fe53e2c609a5c76510aff8e998a4c22285 (patch) | |
tree | 1c4a543f661dd1b281aecf4660388491702fa8d8 /3rdparty/pybind11/tests/conftest.py | |
parent | f1349e114f3a16ccd002e8513339e18f5be4d31b (diff) | |
parent | a72f898ff4c4237424c468044a6db9d6953b541e (diff) | |
download | nextpnr-3983d4fe53e2c609a5c76510aff8e998a4c22285.tar.gz nextpnr-3983d4fe53e2c609a5c76510aff8e998a4c22285.tar.bz2 nextpnr-3983d4fe53e2c609a5c76510aff8e998a4c22285.zip |
Merge pull request #1024 from YosysHQ/gatecat/pybind11-bump
3rdparty: Bump vendored pybind11 version for py3.11 support
Diffstat (limited to '3rdparty/pybind11/tests/conftest.py')
-rw-r--r-- | 3rdparty/pybind11/tests/conftest.py | 31 |
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}" + ) |