[Patches] [Patch #100683] randomize test execution order in regrtest.py

Skip Montanaro skip@mojam.com (Skip Montanaro)
Fri, 30 Jun 2000 10:25:13 -0500 (CDT)


    Guido> OK, go for it.  (It would be cool if there was at least a hackish
    Guido> way to do this with imports too, e.g.

    Guido> import regrtest
    Guido> regrtest.randomize = 1
    Guido> regrtest.main()

Done.  Instead of adding a module-level variable I simply migrated the
initialization of the various flag variables normally set using command line
flags into the main function definition:

    def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
	     exclude=0, single=0, randomize=0):

Also, I noticed that I had to disable my PYTHONSTARTUP environment variable
before running regrtest.main from the interpreter prompt.  test_exceptions
was failing if I didn't do that.  I have no idea yet if my .pythonrc.py file
screwed up the environment somehow or if there is some strange interaction
between the PYTHONSTARTUP logic and test_exceptions.py.  Haven't looked into
that yet.

Skip