https://github.com/python/cpython/commit/e3671ead9419c7afab6a4e501ade86bc9bc10950
commit: e3671ead9419c7afab6a4e501ade86bc9bc10950
branch: 3.12
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-04-21T07:41:54Z
summary:
[3.12] gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122) (#118129)
files:
M Lib/test/test_doctest/test_doctest.py
diff --git a/Lib/test/test_doctest/test_doctest.py
b/Lib/test/test_doctest/test_doctest.py
index 2722661a2363fe..069418453f1f48 100644
--- a/Lib/test/test_doctest/test_doctest.py
+++ b/Lib/test/test_doctest/test_doctest.py
@@ -2488,7 +2488,7 @@ def __call__(self, *args, **kwargs):
self.func(*args, **kwargs)
@Wrapper
-def test_look_in_unwrapped():
+def wrapped():
"""
Docstrings in wrapped functions must be detected as well.
@@ -2496,6 +2496,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
+ """
+
if support.check_impl_detail(cpython=True):
def test_wrapped_c_func():
"""
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]