[Zope3-checkins] CVS: Zope3 - test.py:1.66

Jeremy Hylton jeremy@zope.com
Mon, 30 Jun 2003 18:43:18 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv15433

Modified Files:
	test.py 
Log Message:
Make warnings errors for testing, except for logging, which we don't control.


=== Zope3/test.py 1.65 => 1.66 ===
--- Zope3/test.py:1.65	Mon Jun 30 12:26:30 2003
+++ Zope3/test.py	Mon Jun 30 18:43:17 2003
@@ -163,6 +163,7 @@
 import time
 import traceback
 import unittest
+import warnings
 
 from distutils.util import get_platform
 
@@ -799,6 +800,9 @@
         else:
             print "Running %s tests at level %d" % (kind, level)
 
+    warnings.filterwarnings("error")
+    warnings.filterwarnings("ignore", module="logging")
+
     if args:
         if len(args) > 1:
             test_filter = args[1]
@@ -809,12 +813,20 @@
             # status if on a false return value from main.
             coverdir = os.path.join(os.getcwd(), "coverage")
             import trace
+            ignoremods = ["os", "posixpath", "stat"]
             tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix],
-                                 trace=0, count=1)
+                                 ignoremods=ignoremods,
+                                 trace=False, count=True)
 
             tracer.runctx("main(module_filter, test_filter, libdir)",
                           globals=globals(), locals=vars())
             r = tracer.results()
+            path = "/tmp/trace.%s" % os.getpid()
+            import cPickle
+            f = open(path, "wb")
+            cPickle.dump(r, f)
+            f.close()
+            print path
             r.write_results(show_missing=True, summary=True, coverdir=coverdir)
         else:
             bad = main(module_filter, test_filter, libdir)