summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2024-03-14 10:16:18 (GMT)
committerGitHub <noreply@github.com>2024-03-14 10:16:18 (GMT)
commitf20dfb7569a769da50cd75f4932b9abe78e55d75 (patch)
tree86af430500d34ac5bbb6369db571e6376a03f70a
parent19ac28bd08fdb16795e6f82ea7bfac73e8f3791b (diff)
downloadcpython-f20dfb7569a769da50cd75f4932b9abe78e55d75.zip
cpython-f20dfb7569a769da50cd75f4932b9abe78e55d75.tar.gz
cpython-f20dfb7569a769da50cd75f4932b9abe78e55d75.tar.bz2
gh-116780: Fix `test_inspect` in `-OO` mode (#116788)
-rw-r--r--Lib/test/test_inspect/test_inspect.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py
index 9a9d34d..c3a9dc9 100644
--- a/Lib/test/test_inspect/test_inspect.py
+++ b/Lib/test/test_inspect/test_inspect.py
@@ -991,7 +991,11 @@ class TestBuggyCases(GetSourceBase):
self.assertSourceEqual(mod2.cls196, 194, 201)
self.assertSourceEqual(mod2.cls196.cls200, 198, 201)
+ @support.requires_docstrings
def test_class_inside_conditional(self):
+ # We skip this test when docstrings are not present,
+ # because docstrings are one of the main factors of
+ # finding the correct class in the source code.
self.assertSourceEqual(mod2.cls238.cls239, 239, 240)
def test_multiple_children_classes(self):
@@ -5284,6 +5288,7 @@ class TestSignatureDefinitions(unittest.TestCase):
with self.assertRaises(ValueError):
inspect.signature(func)
+ @support.requires_docstrings
def test_base_class_have_text_signature(self):
# see issue 43118
from test.typinganndata.ann_module7 import BufferedReader