[issue32042] Option for comparing values instead of reprs in doctest

Raymond Hettinger report at bugs.python.org
Sun Nov 19 12:01:01 EST 2017


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I recommend not going down this path.  The intended purpose of doctest is to test examples in documentation.  In particular, those examples should match what a user would *see* when running the examples.  In essence, the proposal is to allow tests to pass even when the examples *don't* match what the user sees.

ISTM, the str_fun() example *should* fail.  It does not show *any* real interactive prompt session than can be reproduced by a user or anything that a user would ever see.   IMO, that would be a documentation anti-pattern.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32042>
_______________________________________


More information about the Python-bugs-list mailing list