]>
gitweb.michael.orlitzky.com - dunshire.git/blob - test/__main__.py
3 An implementation of __main__() that allows us to "run this module."
7 from test
import build_suite
, run_suite
9 # We take two command-line arguments. The first enables you to turn
10 # off the doctests, which are deterministic. The second tells us to
11 # repeat the test suite indefinitely rather than return the result
12 # of running it once. The flags usually occur together so that we
13 # don't waste time running the doctests in a loop.
17 if "--no-doctests" in argv
:
23 # Running the test suite clobbers it! And deepcopy() doesn't work on a
24 # suite that contains doctests! ARRRGRRGRRGRHG!!!!!! You're all idiots.
25 result
= run_suite(build_suite(doctests
))
27 if result
.wasSuccessful() and not loop
:
32 while(result
.wasSuccessful()):
33 print('Passed: {:d}'.format(passed
))
35 result
= run_suite(build_suite(doctests
))