]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122) (#118129)
authorNikita Sobolev <mail@sobolevn.me>
Sun, 21 Apr 2024 07:41:54 +0000 (10:41 +0300)
committerGitHub <noreply@github.com>
Sun, 21 Apr 2024 07:41:54 +0000 (07:41 +0000)
Lib/test/test_doctest/test_doctest.py

index 2722661a2363fe9f217355318bda55167d29c1e9..069418453f1f48a48c8f86b228ea0da684ca06b2 100644 (file)
@@ -2488,7 +2488,7 @@ class Wrapper:
         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():
         """