This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Tomáš Petříček, jbakker, r.david.murray, rhettinger, serhiy.storchaka, tim.peters
Date 2017-11-20.02:02:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511143370.09.0.213398074469.issue32042@psf.upfronthosting.co.za>
In-reply-to
Content
Tomáš, of course you can combine testing methods any way you like.  Don't oversell this - there's nothing actually magical about comparing objects instead of strings ;-)

I'm only -0 on this.  It grates a bit against doctest's original intents, but I appreciate it could be quite useful at times.

About the lack of showing the values when "expr1 == expr2" is false, I don't care.  I can't recall any case where, e.g., assertEqual() showing both values was actually helpful.  To the contrary, it more often filled the screen with giant reprs that were worse than useless.  By its very nature, doctest comparing against an explicit string encourages tests with brief output.  When a test fails, no matter how it's reported non-trivial work to repair it usually follows.  By far the most important part is knowing _what_ failed.

"True matching 1" is a case of practicality beats purity:  a wart for sure, but standing out precisely because it's the only wart of its kind.  I doubt most users are even aware of it, and it's certainly not something most users need to know.

About different shells, it _is_ jarring to people at first that formatting differs among them.  But since the differences show up on every single line of input and output, the differences quickly stop diluting attention.

About how much of repr() output is defined, not really all that much.  The purpose of doctest was never to accept any conceivable implementation that met the letter of the reference manual, but to capture the output CPython actually produced.  That was intentional.  Over time, I count it as a Good Thing that "but what about doctests out there?" has acted as a pressure against gratuitous changes in repr() outputs, and nudged other implementations to make "who cares?" output decisions that matched CPython's.  Every silly difference incurs various costs, and doctest did aim to make the existence of those costs visible at once.  It's a fact of life that relatively few users read the reference manual, let alone understand it - and I don't hate them for that ;-)
History
Date User Action Args
2017-11-20 02:02:50tim.peterssetrecipients: + tim.peters, rhettinger, r.david.murray, serhiy.storchaka, jbakker, Tomáš Petříček
2017-11-20 02:02:50tim.peterssetmessageid: <1511143370.09.0.213398074469.issue32042@psf.upfronthosting.co.za>
2017-11-20 02:02:50tim.peterslinkissue32042 messages
2017-11-20 02:02:47tim.peterscreate