chiark / gitweb /
documentation/python: test for false positives for pybind signatures.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 4 Sep 2019 18:19:50 +0000 (20:19 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 4 Sep 2019 18:20:46 +0000 (20:20 +0200)
This blows up. Heh.

documentation/test_python/pybind_signatures/false_positives.html [new file with mode: 0644]
documentation/test_python/pybind_signatures/false_positives.py [new file with mode: 0644]
documentation/test_python/test_pybind.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 (file)
index 0000000..1ee37cf
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>false_positives | My Python Project</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Python Project</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          false_positives <span class="m-thin">module</span>
+        </h1>
+        <div class="m-block m-default">
+          <h3>Contents</h3>
+          <ul>
+            <li>
+              Reference
+              <ul>
+                <li><a href="#functions">Functions</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div>
+        <section id="functions">
+          <h2><a href="#functions">Functions</a></h2>
+          <dl class="m-doc">
+            <dt id="reset">
+              <span class="m-doc-wrap-bumper">def <a href="#reset" class="m-doc-self">reset</a>(</span><span class="m-doc-wrap">)</span>
+            </dt>
+            <dd>resets everything</dd>
+          </dl>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/documentation/test_python/pybind_signatures/false_positives.py b/documentation/test_python/pybind_signatures/false_positives.py
new file mode 100644 (file)
index 0000000..9d64792
--- /dev/null
@@ -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."""
index 444e5b0494fbfe58af112cda9c51d70babeee97c..d301d8e08402c65d5c1fe8cf85f70b82795d22d4 100644 (file)
@@ -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