https://github.com/python/cpython/commit/ccda73828473576c57d1bb31774f56542d6e8964
commit: ccda73828473576c57d1bb31774f56542d6e8964
branch: main
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-04-21T10:08:32+03:00
summary:

gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122)

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 f71d62cc174d6b..cba4b16d544a20 100644
--- a/Lib/test/test_doctest/test_doctest.py
+++ b/Lib/test/test_doctest/test_doctest.py
@@ -2545,7 +2545,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.
 
@@ -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():
     """

_______________________________________________
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]

Reply via email to