Tim Peters <[email protected]> added the comment:
`doctest` is intended to be anal - there are few things more pointlessly
confusing for a user than to see docs that don't match what they actually see
when they run the doc's examples. "Is it a bug? Did I do it wrong? Why can't
they document what it actually does?! ..."
Things like +ELLIPSIS are intended for cases where the output is _known_ to
vary across platforms or runs in ways that can't otherwise be easily hidden
(like output that embeds the `id()` of an object), or where only a relatively
tiny bit of enormous output is actually interesting.
When someone wants unittest's `assertEqual()`, they should use unittest ;-)
Although that functionality is already easily handled; for example, here's the
OP's first example rewritten to be independent of the dict's representation
ordering:
>>> dict_fun() == {'foo': 1, 'bar': 2}
True
Now it's testing what you want to test: that the results of the expressions on
both sides of `==` compare equal. And this is, to me, clearer on the face of
it than introducing a new flag.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com