diff options
author | Barry Warsaw <barry@python.org> | 1996-12-10 23:10:39 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1996-12-10 23:10:39 (GMT) |
commit | 2e644a0f8653caea88b0143a36c9a3ba5a836f73 (patch) | |
tree | 26708c459689ac84eb95570e73ae808f5c698837 /Lib/test | |
parent | 272c00b634d08fe7813a994f8ba78077c6b7094c (diff) | |
download | cpython-2e644a0f8653caea88b0143a36c9a3ba5a836f73.zip cpython-2e644a0f8653caea88b0143a36c9a3ba5a836f73.tar.gz cpython-2e644a0f8653caea88b0143a36c9a3ba5a836f73.tar.bz2 |
When run as a script, runs each test and sends results to stdout
(i.e. this restores the old functionality).
Note that if a test couldn't be imported, it is just ignored (and no
warning is printed).
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/testall.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/testall.py b/Lib/test/testall.py index a132bfe..b472c7f 100644 --- a/Lib/test/testall.py +++ b/Lib/test/testall.py @@ -17,3 +17,20 @@ tests = ['test_grammar', 'test_dbm', 'test_new', ] + +if __name__ == '__main__': + # low-overhead testing, for cases where autotest.py harness + # doesn't even work! + import sys + from test_support import * + + for t in tests: + print t + unload(t) + try: + __import__(t, globals(), locals()) + except ImportError, msg: +## sys.stderr.write('%s. Uninstalled optional module?\n' % msg) + pass + + print 'Passed all tests.' |