8000 gh-116780: Fix `test_inspect` in `-OO` mode (#116788) · python/cpython@f20dfb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit f20dfb7

Browse files
authored
gh-116780: Fix test_inspect in -OO mode (#116788)
1 parent 19ac28b commit f20dfb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,11 @@ def test_class_decorator(self):
991991
self.assertSourceEqual(mod2.cls196, 194, 201)
992992
self.assertSourceEqual(mod2.cls196.cls200, 198, 201)
993993

8000 994+
@support.requires_docstrings
994995
def test_class_inside_conditional(self):
996+
# We skip this test when docstrings are not present,
997+
# because docstrings are one of the main factors of
998+
# finding the correct class in the source code.
995999
self.assertSourceEqual(mod2.cls238.cls239, 239, 240)
9961000

9971001
def test_multiple_children_classes(self):
@@ -5284,6 +5288,7 @@ def func(*args, **kwargs):
52845288
with self.assertRaises(ValueError):
52855289
inspect.signature(func)
52865290

5291+
@support.requires_docstrings
52875292
def test_base_class_have_text_signature(self):
52885293
# see issue 43118
52895294
from test.typinganndata.ann_module7 import BufferedReader

0 commit comments

Comments
 (0)
0