-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Improved error reporting for doctests run with unittest #134857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
May 28, 2025
Remove doctest module frames from tracebacks and redundand newline character from a failure message.
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
May 28, 2025
Remove doctest module frames from tracebacks and redundant newline character from a failure message.
@hugovk, this is borderline between a bug fix and a new feature. On one hand, the current behavior is wrong. On other hand, it was so from beginning, so some code can depend on exact output, although this is unlikely, because these details look wrong and unstable. So I think that this change can be backported to 3.14, but not to 3.13. |
serhiy-storchaka
added a commit
that referenced
this issue
May 29, 2025
…4858) Remove doctest module frames from tracebacks and redundant newline character from a failure message.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 29, 2025
…ythonGH-134858) Remove doctest module frames from tracebacks and redundant newline character from a failure message. (cherry picked from commit cb8a72b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
that referenced
this issue
May 30, 2025
…GH-134858) (GH-134903) Remove doctest module frames from tracebacks and redundant newline character from a failure message. (cherry picked from commit cb8a72b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
There are several issues with error reports when doctests are wrapped in
DocTestCase
.When error happens during compilation or execution an example, the traceback contains several lines from
doctest.py
:When the output differs, the traceback of AssertionError contains other line from
doctest.py
:Also, the AssertionError message contains redundant newline character.
Linked PRs
The text was updated successfully, but these errors were encountered: