[Python-Dev] test_doctest failing, but perhaps by accident

Tim Peters tim.one@home.com
Wed, 21 Mar 2001 16:13:14 -0500


[Jeremy]
> How does doctest fail?  Does that give any indication of the nature of
> the problem?  Does it fail with a core dump (or whatever Windows does
> instead)?  Or is the output wrong?

Sorry, I should know better than to say "doesn't work".  It's that the output
is wrong:

It's good up through the end of this section of output:

...
1 items had failures:
   1 of   2 in XYZ
4 tests in 2 items.
3 passed and 1 failed.
***Test Failed*** 1 failures.
(1, 4)
ok
0 of 6 examples failed in doctest.Tester.__doc__
Running doctest.Tester.__init__.__doc__
0 of 0 examples failed in doctest.Tester.__init__.__doc__
Running doctest.Tester.run__test__.__doc__
0 of 0 examples failed in doctest.Tester.run__test__.__doc__
Running


But then:

We expected (repr): 'doctest.Tester.runstring.__doc__'
But instead we got: 'doctest.Tester.summarize.__doc__'


Hmm!  Perhaps doctest is merely running sub-tests in a different order.
doctest uses whatever order dict.items() returns (for the module __dict__ and
class __dict__s, etc).  It should probably force the order.  I'm going to get
something to eat and ponder that ... if true, The Mystery is how the internal
dicts could get *built* in a different order across runs ...

BTW, does or doesn't a run of the full test suite complain here too under
your Linux box?