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
Doctest capture only AssertionError but not printed text #65382
Comments
|
The following doctest should pass, but it fails: >>> def spam(): print("eggs")
...
>>> assert spam()
eggs
Traceback (most recent call last):
AssertionErrorBut if we remove the print output from printed results the test pass: >>> def spam(): print("eggs")
...
>>> assert spam()
Traceback (most recent call last):
AssertionErrorI'm writing the 2nd edition of a book about Python (covering python3) and Django and I'm using doctest to run the interactive sessions that I use as examples in book. |
|
The first footnote in the docs explain this: So, sorry, but this is intentionally not supported. |
|
Hi Tim, I tried to find more information in documentation before opening this bug but I need to confess that I didn't read the footnote. Thanks and sorry for the invalid report. |
|
Personally, I think that the second reason given in the footnote, that it makes for confusing tests, is bogus, or at least it's a matter of opinion. I for one don't think they are confusing, and would like to see mixed output/tracebacks supported. Tim, would you accept this being reopened as an Enhancement request for 3.5 rather than a bug fix? |
|
Steven, no objection here. |
osantana mannequin commentedApr 9, 2014
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: