Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e3671ea

Browse filesBrowse files
authored
[3.12] gh-118121: Fix test_doctest.test_look_in_unwrapped (#118122) (#118129)
1 parent 4d85f0a commit e3671ea
Copy full SHA for e3671ea

File tree

Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed

‎Lib/test/test_doctest/test_doctest.py

Copy file name to clipboardExpand all lines: Lib/test/test_doctest/test_doctest.py
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,14 +2488,29 @@ def __call__(self, *args, **kwargs):
24882488
self.func(*args, **kwargs)
24892489

24902490
@Wrapper
2491-
def test_look_in_unwrapped():
2491+
def wrapped():
24922492
"""
24932493
Docstrings in wrapped functions must be detected as well.
24942494
24952495
>>> 'one other test'
24962496
'one other test'
24972497
"""
24982498

2499+
def test_look_in_unwrapped():
2500+
"""
2501+
Ensure that wrapped doctests work correctly.
2502+
2503+
>>> import doctest
2504+
>>> doctest.run_docstring_examples(
2505+
... wrapped, {}, name=wrapped.__name__, verbose=True)
2506+
Finding tests in wrapped
2507+
Trying:
2508+
'one other test'
2509+
Expecting:
2510+
'one other test'
2511+
ok
2512+
"""
2513+
24992514
if support.check_impl_detail(cpython=True):
25002515
def test_wrapped_c_func():
25012516
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.