diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-04-21 07:41:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-21 07:41:54 (GMT) |
commit | e3671ead9419c7afab6a4e501ade86bc9bc10950 (patch) | |
tree | 742f91b5a81c19eae5f8a34aa70ba8a70072144d /Lib/test | |
parent | 4d85f0ae76b84bfdba961154e9e38bde27242b9f (diff) | |
download | cpython-e3671ead9419c7afab6a4e501ade86bc9bc10950.zip cpython-e3671ead9419c7afab6a4e501ade86bc9bc10950.tar.gz cpython-e3671ead9419c7afab6a4e501ade86bc9bc10950.tar.bz2 |
[3.12] gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122) (#118129)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_doctest/test_doctest.py | 17 |
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 2722661..0694184 100644 --- a/Lib/test/test_doctest/test_doctest.py +++ b/Lib/test/test_doctest/test_doctest.py @@ -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(): """ |