summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-12-18 16:39:31 (GMT)
committerBarry Warsaw <barry@python.org>1996-12-18 16:39:31 (GMT)
commitaf82a7ef4940c8f1df6c935826b03c34bcf05bc5 (patch)
tree04e665c2d30c9429f946dcdf0e261a5e7b7c04cc /Lib/test
parent4a4880966b04ad29671f9aa4e4457269e2ede4de (diff)
downloadcpython-af82a7ef4940c8f1df6c935826b03c34bcf05bc5.zip
cpython-af82a7ef4940c8f1df6c935826b03c34bcf05bc5.tar.gz
cpython-af82a7ef4940c8f1df6c935826b03c34bcf05bc5.tar.bz2
In lieu of harness rewrite, fixed problem with test_thread ImportError
triggering a bogus TestFailed exception.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/autotest.py31
1 files changed, 14 insertions, 17 deletions
diff --git a/Lib/test/autotest.py b/Lib/test/autotest.py
index 060fd82..6791034 100644
--- a/Lib/test/autotest.py
+++ b/Lib/test/autotest.py
@@ -108,9 +108,15 @@ def do_one_test(t, outdir):
if warn:
sys.stderr.write(msg+': Un-installed'
' optional module?\n')
+ try:
+ fake_stdout.close()
+ except TestFailed:
+ pass
+ fake_stdout = None
finally:
sys.stdout = real_stdout
- fake_stdout.close()
+ if fake_stdout:
+ fake_stdout.close()
@@ -139,26 +145,17 @@ def main():
else:
import testall
tests = testall.tests
- failed = []
- missing = []
+ failed = 0
for test in tests:
+ print 'testing:', test
try:
do_one_test(test, outdir)
except TestFailed, msg:
- traceback.print_exc()
- failed.append(test)
- except TestMissing:
- missing.append(test)
- print '**********\n* Report *\n**********'
- if not failed and not missing:
+ print 'test', test, 'failed'
+ failed = failed + 1
+ if not failed:
print 'All tests OK.'
- if failed:
- print 'Failed tests:'
- for t in failed:
- print ' ', t
- if missing:
- print 'Missing tests:'
- for t in missing:
- print ' ', t
+ else:
+ print failed, 'tests failed'
main()