chiark / gitweb /
documentation/python: typing.Generic.__new__() is gone in 3.9.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 2 Jan 2022 21:21:50 +0000 (22:21 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 3 Jan 2022 01:36:44 +0000 (02:36 +0100)
documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html [new file with mode: 0644]
documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html
documentation/test_python/test_inspect.py

diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html
new file mode 100644 (file)
index 0000000..fcc0e6e
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>inspect_annotations.AContainer | 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>
+          <span class="m-breadcrumb"><a href="inspect_annotations.html">inspect_annotations</a>.<wbr/></span>AContainer <span class="m-thin">class</span>
+        </h1>
+        <p>A generic class. No parent class info extracted yet.</p>
+        <div class="m-block m-default">
+          <h3>Contents</h3>
+          <ul>
+            <li>
+              Reference
+              <ul>
+                <li><a href="#dunder-methods">Special methods</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div>
+        <section id="dunder-methods">
+          <h2><a href="#dunder-methods">Special methods</a></h2>
+          <dl class="m-doc">
+            <dt id="__new__">
+              <span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
+            </dt>
+            <dd></dd>
+          </dl>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
index fcc0e6e59c34bbe68f969831f95723b078a5de2e..4cce96c66068151b5642cff7b26afef0e3336ad8 100644 (file)
           <span class="m-breadcrumb"><a href="inspect_annotations.html">inspect_annotations</a>.<wbr/></span>AContainer <span class="m-thin">class</span>
         </h1>
         <p>A generic class. No parent class info extracted yet.</p>
-        <div class="m-block m-default">
-          <h3>Contents</h3>
-          <ul>
-            <li>
-              Reference
-              <ul>
-                <li><a href="#dunder-methods">Special methods</a></li>
-              </ul>
-            </li>
-          </ul>
-        </div>
-        <section id="dunder-methods">
-          <h2><a href="#dunder-methods">Special methods</a></h2>
-          <dl class="m-doc">
-            <dt id="__new__">
-              <span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
-            </dt>
-            <dd></dd>
-          </dl>
-        </section>
       </div>
     </div>
   </div>
index e882390469b47b1c80488da210e0c8d39db02071..8c5a642aa0cbcffe110f9a5127d87d05bc1462be 100644 (file)
@@ -92,8 +92,12 @@ class Annotations(BaseInspectTestCase):
         self.assertEqual(*self.actual_expected_contents('inspect_annotations.Foo.html'))
         self.assertEqual(*self.actual_expected_contents('inspect_annotations.FooSlots.html'))
 
-        # This should not list any internal stuff from the typing module
-        self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html'))
+        # This should not list any internal stuff from the typing module. The
+        # Generic.__new__() is gone in 3.9: https://bugs.python.org/issue39168
+        if LooseVersion(sys.version) >= LooseVersion('3.9.0'):
+            self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html'))
+        else:
+            self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html', 'inspect_annotations.AContainer-py36-38.html'))
 
     # https://github.com/python/cpython/pull/13394
     @unittest.skipUnless(LooseVersion(sys.version) >= LooseVersion('3.7.4'),