From 7301a85b2cef514229073ad11ef6ad1ebae87b1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 2 Jan 2022 22:21:50 +0100 Subject: [PATCH] documentation/python: typing.Generic.__new__() is gone in 3.9. --- ...nspect_annotations.AContainer-py36-38.html | 51 +++++++++++++++++++ .../inspect_annotations.AContainer.html | 20 -------- documentation/test_python/test_inspect.py | 8 ++- 3 files changed, 57 insertions(+), 22 deletions(-) create mode 100644 documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html 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 index 00000000..fcc0e6e5 --- /dev/null +++ b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html @@ -0,0 +1,51 @@ + + + + + inspect_annotations.AContainer | My Python Project + + + + + +
+
+ + diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html index fcc0e6e5..4cce96c6 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html +++ b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html @@ -23,26 +23,6 @@ inspect_annotations.AContainer class

A generic class. No parent class info extracted yet.

-
-

Contents

- -
-
-

Special methods

-
-
- def __new__(cls, *args, **kwds) -
-
-
-
diff --git a/documentation/test_python/test_inspect.py b/documentation/test_python/test_inspect.py index e8823904..8c5a642a 100644 --- a/documentation/test_python/test_inspect.py +++ b/documentation/test_python/test_inspect.py @@ -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'), -- 2.30.2