summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_doctest
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2024-04-21 07:08:32 (GMT)
committerGitHub <noreply@github.com>2024-04-21 07:08:32 (GMT)
commitccda73828473576c57d1bb31774f56542d6e8964 (patch)
treece98d8d5eedca1f1cfdc0edceb6f3b74b520b370 /Lib/test/test_doctest
parent5fa5b7facbcd1f725e51daf31c321e02b7db3f02 (diff)
downloadcpython-ccda73828473576c57d1bb31774f56542d6e8964.zip
cpython-ccda73828473576c57d1bb31774f56542d6e8964.tar.gz
cpython-ccda73828473576c57d1bb31774f56542d6e8964.tar.bz2
gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122)
Diffstat (limited to 'Lib/test/test_doctest')
-rw-r--r--Lib/test/test_doctest/test_doctest.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/test/test_doctest/test_doctest.py b/Lib/test/test_doctest/test_doctest.py
index f71d62c..cba4b16 100644
--- a/Lib/test/test_doctest/test_doctest.py
+++ b/Lib/test/test_doctest/test_doctest.py
@@ -2545,7 +2545,7 @@ class Wrapper:
self.func(*args, **kwargs)
@Wrapper
-def test_look_in_unwrapped():
+def wrapped():
"""
Docstrings in wrapped functions must be detected as well.
@@ -2553,6 +2553,21 @@ def test_look_in_unwrapped():
'one other test'
"""
+def test_look_in_unwrapped():
+ """
+ Ensure that wrapped doctests work correctly.
+
+ >>> import doctest
+ >>> doctest.run_docstring_examples(
+ ... wrapped, {}, name=wrapped.__name__, verbose=True)
+ Finding tests in wrapped
+ Trying:
+ 'one other test'
+ Expecting:
+ 'one other test'
+ ok
+ """
+
@doctest_skip_if(support.check_impl_detail(cpython=False))
def test_wrapped_c_func():
"""