From aa00e0c10d10021f8c91b18b649860b8c6d921e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 4 Sep 2019 20:19:50 +0200 Subject: [PATCH] documentation/python: test for false positives for pybind signatures. This blows up. Heh. --- .../pybind_signatures/false_positives.html | 50 +++++++++++++++++++ .../pybind_signatures/false_positives.py | 4 ++ documentation/test_python/test_pybind.py | 4 ++ 3 files changed, 58 insertions(+) create mode 100644 documentation/test_python/pybind_signatures/false_positives.html create mode 100644 documentation/test_python/pybind_signatures/false_positives.py diff --git a/documentation/test_python/pybind_signatures/false_positives.html b/documentation/test_python/pybind_signatures/false_positives.html new file mode 100644 index 00000000..1ee37cf9 --- /dev/null +++ b/documentation/test_python/pybind_signatures/false_positives.html @@ -0,0 +1,50 @@ + + + + + false_positives | My Python Project + + + + + +
+
+
+
+
+

+ false_positives module +

+
+

Contents

+ +
+
+

Functions

+
+
+ def reset() +
+
resets everything
+
+
+
+
+
+
+ + diff --git a/documentation/test_python/pybind_signatures/false_positives.py b/documentation/test_python/pybind_signatures/false_positives.py new file mode 100644 index 00000000..9d647926 --- /dev/null +++ b/documentation/test_python/pybind_signatures/false_positives.py @@ -0,0 +1,4 @@ + +# This shouldn't be treated as a pybind signature +def reset(): + """resets everything. Shouldn't be picked as a pybind signature.""" diff --git a/documentation/test_python/test_pybind.py b/documentation/test_python/test_pybind.py index 444e5b04..d301d8e0 100644 --- a/documentation/test_python/test_pybind.py +++ b/documentation/test_python/test_pybind.py @@ -217,11 +217,15 @@ class Signatures(BaseInspectTestCase): pybind_signatures.MyClass.another(self=a) def test(self): + sys.path.append(self.path) + import pybind_signatures self.run_python({ + 'INPUT_MODULES': [pybind_signatures, 'false_positives'], 'PYBIND11_COMPATIBILITY': True }) self.assertEqual(*self.actual_expected_contents('pybind_signatures.html')) self.assertEqual(*self.actual_expected_contents('pybind_signatures.MyClass.html')) + self.assertEqual(*self.actual_expected_contents('false_positives.html')) sys.path.append(self.path) import pybind_signatures -- 2.30.2