From: Vladimír Vondruš Date: Wed, 4 Sep 2019 18:19:50 +0000 (+0200) Subject: documentation/python: test for false positives for pybind signatures. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=aa00e0c10d10021f8c91b18b649860b8c6d921e0;p=blog.git documentation/python: test for false positives for pybind signatures. This blows up. Heh. --- 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