Update of /cvsroot/docstring/dps/test
In directory usw-pr-cvs1:/tmp/cvs-serv12697/dps/test
Added Files:
alltests.py
Log Message:
Run all tests.
--- NEW FILE: alltests.py ---
#!/usr/bin/env python
"""
:Author: David Goodger
:Contact: go...@us...
:Revision: $Revision: 1.1 $
:Date: $Date: 2001/09/17 04:02:26 $
:Copyright: This module has been placed in the public domain.
"""
import time
start = time.time()
import sys, os
class Tee:
"""Write to a file and a stream (default: stdout) simultaneously."""
def __init__(self, filename, stream=sys.__stdout__):
self.file = open(filename, 'w')
self.stream = stream
def write(self, string):
self.stream.write(string)
self.file.write(string)
# must redirect stderr *before* first import of unittest
sys.stdout = sys.stderr = Tee('alltests.out')
import UnitTestFolder
if __name__ == '__main__':
path, script = os.path.split(sys.argv[0])
suite = UnitTestFolder.loadModulesFromFolder(path, 'test_', subfolders=1)
UnitTestFolder.main(suite)
finish = time.time()
print 'Elapsed time: %.3f seconds' % (finish - start)
|