diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-09-09 06:12:01 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-09-09 06:12:01 (GMT) |
commit | a0a62225094a890c1b07ebc4f89e4c7c45c66b13 (patch) | |
tree | 147057adad1ae5b6548b708753a2febe91080d5f /Lib/test/test_generators.py | |
parent | 90ba8d9c80c4eba418ca2ddaefbf59c4acf00cf3 (diff) | |
download | cpython-a0a62225094a890c1b07ebc4f89e4c7c45c66b13.zip cpython-a0a62225094a890c1b07ebc4f89e4c7c45c66b13.tar.gz cpython-a0a62225094a890c1b07ebc4f89e4c7c45c66b13.tar.bz2 |
Teach regrtest how to pass on doctest failure msgs. This is done via a
horridly inefficient hack in regrtest's Compare class, but it's about as
clean as can be: regrtest has to set up the Compare instance before
importing a test module, and by the time the module *is* imported it's too
late to change that decision. The good news is that the more tests we
convert to unittest and doctest, the less the inefficiency here matters.
Even now there are few tests with large expected-output files (the new
cost here is a Python-level call per .write() when there's an expected-
output file).
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r-- | Lib/test/test_generators.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 0e9d060..118b1d9 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1351,16 +1351,16 @@ __test__ = {"tut": tutorial_tests, # This worms around a bootstrap problem. # Note that doctest and regrtest both look in sys.argv for a "-v" argument, # so this works as expected in both ways of running regrtest. -def test_main(): - import doctest, test_generators +def test_main(verbose=None): + import doctest, test_support, test_generators if 0: # change to 1 to run forever (to check for leaks) while 1: doctest.master = None - doctest.testmod(test_generators) + test_support.run_doctest(test_generators, verbose) print ".", else: - doctest.testmod(test_generators) + test_support.run_doctest(test_generators, verbose) # This part isn't needed for regrtest, but for running the test directly. if __name__ == "__main__": - test_main() + test_main(1) |