Changes between Initial Version and Version 1 of Ticket #715, comment 320


Ignore:
Timestamp:
09/13/12 23:36:39 (7 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #715, comment 320

    initial v1  
    88    EXAMPLE 6
    99}}}
    10 etcetera, the segfault vanished (of course!) but I didn't see all test appear in numerical order. I guess I was just blocking that because of the severe cognitive dissonance this was causing, but your remark now makes it unavoidable to acknowledge. Perhaps if we equip every test with a line
     10etcetera, the segfault vanished (of course!) but I didn't see all test appear in numerical order. I guess I was just blocking that because of the severe cognitive dissonance this was causing, but your remark now makes it unavoidable to acknowledge.
     11
     12Indeed, reading the generated `.py` file:
     13{{{
     14...
     15    m = sys.modules[__name__]
     16...
     17        runner = sagedoctest.testmod_returning_runner(m,
     18...
     19}}}
     20so the doctestrunner gets a hold of which doctests to run by getting passed the ''module'' `__main__`. At that point, it can basically only look up the runnable methods in the dictionary, so ordering is not guaranteed. It likely just extracts the doctests by the usual docstring introspecion tools.
     21
     22Perhaps if we equip every test with a line
    1123{{{
    1224    >>> sys.stderr.write('testing test 6\n')
    1325}}}
    14 we may might be able to see the actual order in which the examples are tested without preventing the doctest from happening. Perhaps when we establish that, we can strip out the silly doctesting layer and just have a plain python input file?
     26we may might be able to see the actual order in which the examples are tested without preventing the doctest from happening. Perhaps when we establish that, we can strip out the (for us) silly doctesting layer and just have a plain python input file? Or take a guess and hope that `__main__.__dict__` is listing the tests in the order they are tested.