[Zope-Checkins] CVS: Zope/utilities - testrunner.py:1.23.2.1

Chris Withers chrisw@nipltd.com
Tue, 29 Jan 2002 11:22:39 -0500


Update of /cvs-repository/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv15406

Modified Files:
      Tag: Zope-2_5-branch
	testrunner.py 
Log Message:
merge option changes from head.

=== Zope/utilities/testrunner.py 1.23 => 1.23.2.1 ===
 
     def runSuite(self, suite):
-        runner=unittest.TextTestRunner(verbosity=self.verbosity)
+        runner=unittest.TextTestRunner(stream=sys.stderr, verbosity=self.verbosity)
         self.results.append(runner.run(suite))
 
     def report(self, message):
@@ -257,6 +257,11 @@
           whether it succeeded.  Running with -q is the same as
           running with -v1.
 
+       -o filename
+
+          Output test results to the specified file rather than
+          to stderr.
+
        -h
 
           Display usage information.
@@ -269,7 +274,7 @@
     mega_suite = 1
     set_python_path = 1
 
-    options, arg=getopt.getopt(args, 'amPhd:f:v:qM')
+    options, arg=getopt.getopt(args, 'amPhd:f:v:qMo:')
     if not options:
         err_exit(usage_msg)
     for name, value in options:
@@ -294,6 +299,9 @@
             verbosity = int(value)
         elif name == 'q':
             verbosity = 1
+        elif name == 'o':
+            f = open(value,'w')
+            sys.stderr = f
         else:
             err_exit(usage_msg)