Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccda738

Browse files
authored
gh-118121: Fix test_doctest.test_look_in_unwrapped (#118122)
1 parent 5fa5b7f commit ccda738

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Lib/test/test_doctest/test_doctest.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2545,14 +2545,29 @@ def __call__(self, *args, **kwargs):
25452545
self.func(*args, **kwargs)
25462546

25472547
@Wrapper
2548-
def test_look_in_unwrapped():
2548+
def wrapped():
25492549
"""
25502550
Docstrings in wrapped functions must be detected as well.
25512551
25522552
>>> 'one other test'
25532553
'one other test'
25542554
"""
25552555

2556+
def test_look_in_unwrapped():
2557+
"""
2558+
Ensure that wrapped doctests work correctly.
2559+
2560+
>>> import doctest
2561+
>>> doctest.run_docstring_examples(
2562+
... wrapped, {}, name=wrapped.__name__, verbose=True)
2563+
Finding tests in wrapped
2564+
Trying:
2565+
'one other test'
2566+
Expecting:
2567+
'one other test'
2568+
ok
2569+
"""
2570+
25562571
@doctest_skip_if(support.check_impl_detail(cpython=False))
25572572
def test_wrapped_c_func():
25582573
"""

0 commit comments

Comments
 (0)