diff options
| author | (no author) <(no author)@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-05-01 02:53:07 +0000 |
|---|---|---|
| committer | (no author) <(no author)@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-05-01 02:53:07 +0000 |
| commit | 9e0c8b3997b83945c58c5ede77278f205b97d03e (patch) | |
| tree | 5fdea7c382ce0fdcc49bc2bc0f9e8faaa7f4effc /docutils/test/alltests.py | |
| parent | 6a5511292419427c9a4c9258b71c47d072a02878 (diff) | |
| download | docutils-tibs.tar.gz | |
This commit was manufactured by cvs2svn to create branch 'tibs'.tibs
git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/tibs@63 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/alltests.py')
| -rwxr-xr-x | docutils/test/alltests.py | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/docutils/test/alltests.py b/docutils/test/alltests.py deleted file mode 100755 index a01a60ee5..000000000 --- a/docutils/test/alltests.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -All modules named 'test_*.py' in the current directory, and recursively in -subdirectories (packages) called 'test_*', are loaded and test suites within -are run. -""" - -import time -# Start point for actual elapsed time, including imports -# and setup outside of unittest. -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): - string = string.encode('raw-unicode-escape') - self.stream.write(string) - self.file.write(string) - -# must redirect stderr *before* first import of unittest -sys.stdout = sys.stderr = Tee('alltests.out') - - -def pformat(suite): - step = 4 - suitestr = repr(suite).replace('=[<', '=[\n<').replace(', ', ',\n') - indent = 0 - output = [] - for line in suitestr.splitlines(): - output.append(' ' * indent + line) - if line[-1:] == '[': - indent += step - else: - if line [-5:] == ']>]>,': - indent -= step * 2 - elif line[-3:] == ']>,': - indent -= step - return '\n'.join(output) - - -if __name__ == '__main__': - import package_unittest - path, script = os.path.split(sys.argv[0]) - suite = package_unittest.loadTestModules(path, 'test_', packages=1) - package_unittest.main(suite) - #if package_unittest.verbosity > 1: - # print >>sys.stderr, pformat(suite) # check the test suite - finish = time.time() - print 'Elapsed time: %.3f seconds' % (finish - start) |
