[issue7583] doctest should normalize tabs when comparing output

R. David Murray report at bugs.python.org
Sun Apr 4 05:30:35 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

I think I can see how it would cause confusion, and in general it shouldn't be necessary to use real tabs in a doctest.  So as you say the output should be fixed to match.

However, I don't think the patch is quite correct.  It looks to me like the expandtabs call should be made unconditionally on the output string just like it is on the string pulled from the file.  The reason is that the tabs in the output should be expanded relative to the start of the output line.  The indentation is meaningless in that context.  The way you did it, the output in your test appears to be indented incorrectly.  If the expandtabs were done on the raw output string, it would be indented eight spaces from the start of the test indent, and that would look correct.

Your change of 'iff' to 'if' is also most likely incorrect.  I'm pretty sure that 'iff' is intentional (it is an abbreviation for "if and only if".)

----------
assignee:  -> r.david.murray
resolution:  -> accepted
stage:  -> patch review

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


More information about the Python-bugs-list mailing list