aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/conftest.py
diff options
context:
space:
mode:
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}"
+ )
.highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

#include "ar9331.dtsi"

/ {
	model = "TP-Link TL-WR710N v1";
	compatible = "tplink,tl-wr710n-v1", "qca,ar9331";

	aliases {
		serial0 = &uart;
		led-boot = &led_system;
		led-failsafe = &led_system;
		led-running = &led_system;
		led-upgrade = &led_system;
		label-mac-device = &eth0;
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};
	};

	leds {
		compatible = "gpio-leds";

		led_system: system {
			label = "tl-wr710n:green:system";
			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
		};
	};

	reg_usb_vbus: regulator {
		compatible = "regulator-fixed";
		regulator-name = "usb_vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio 8 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};
};

&spi {
	status = "okay";
	num-cs = <1>;

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <25000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			uboot: partition@0 {
				reg = <0x0 0x20000>;
				label = "u-boot";
				read-only;
			};

			firmware: partition@20000 {
				compatible = "tplink,firmware";
				reg = <0x20000 0x7d0000>;
				label = "firmware";
			};

			art: partition@7f0000 {
				reg = <0x7f0000 0x10000>;
				label = "art";
				read-only;
			};
		};
	};
};

&eth0 {
	status = "okay";

	mtd-mac-address = <&uboot 0x1fc00>;

	gmac-config {
		device = <&gmac>;

		switch-phy-addr-swap = <0>;
		switch-phy-swap = <0>;
	};
};

&eth1 {
	status = "okay";

	mtd-mac-address = <&uboot 0x1fc00>;
	mtd-mac-address-increment = <(-1)>;
};

&gpio {
	status = "okay";
};

&uart {
	status = "okay";
};

&usb {
	dr_mode = "host";
	vbus-supply = <&reg_usb_vbus>;
	status = "okay";
};

&usb_phy {
	status = "okay";
};

&wmac {
	status = "okay";
	mtd-cal-data = <&art 0x1000>;
	mtd-mac-address = <&uboot 0x1fc00>;
};