[issue3722] print followed by exception eats print with doctest

Terry J. Reedy report at bugs.python.org
Wed Mar 9 06:01:45 CET 2011


Terry J. Reedy <tjreedy at udel.edu> added the comment:

For the purpose of this tracker, a 'bug' (behavior issue) is a discrepancy between doc and behavior. Micro ('bugfix') releases fix such discrepancies, which are all unintentional.

Every feature request addresses what someone considers a 'design bug'. Micro releases are not intended to contain intentional design changes.
So yes, documenting a design decision makes it not a tracker behavior issue, even if you consider that decision a design bug.

That said, I do not see that temporary debugging output belongs in relatively permanent doctests. That will make the doctest fail as soon as the debugging output is turned back off.

A function whose permanent api is to print to stdout as a side-effect and then raise an exception is very unusual. So I think it OK for doctest to not cover such a thing.

Without a real-world use case, I am inclined to close this issue. Even then, a unittest, where output and exception channels are not mixed together, might be a better choice.

----------
nosy: +terry.reedy
versions: +Python 3.3 -Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3722>
_______________________________________


More information about the Python-bugs-list mailing list