
March 2, 2012
5:36 a.m.
Steven D'Aprano wrote:
This approach doesn't try to be too clever: it's a dumb, understandable test which should fit in nicely with the other tests in doctest.OutputChecker.check_output, perhaps something like this:
if optionflags & IGNORE_WORD_ORDER: if sorted(got.split()) == sorted(want.split()): return True
Ah, buggarit, too simple. I neglected to take into account the delimiters. Getting this right is harder than I thought, particularly with nested sets/dicts. Still, I reckon a directive is the right approach. -- Steven