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

Tim Peters tim.one@comcast.net
Tue, 1 Jul 2003 10:02:07 -0400


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

Modified Files:
	test.py 
Log Message:
Stop spurious errors in test_datetime.  We need to approach converting
warnings->errors in some other way.


=== Zope3/test.py 1.66 => 1.67 ===
--- Zope3/test.py:1.66	Mon Jun 30 18:43:17 2003
+++ Zope3/test.py	Tue Jul  1 10:02:06 2003
@@ -43,7 +43,7 @@
     Unfortunately, the debug harness doesn't print the name of the
     test, so Use With Care.
 
---dir directory 
+--dir directory
     Option to limit where tests are searched for. This is
     important when you *really* want to limit the code that gets run.
     For example, if refactoring interfaces, you don't want to see the way
@@ -596,10 +596,10 @@
     pathinit = PathInit(build, build_inplace, libdir)
 
     # Initialize the logging module.
-    
+
     import logging.config
     logging.basicConfig()
-        
+
     level = os.getenv("LOGGING")
     if level:
         level = int(level)
@@ -609,7 +609,7 @@
 
     if os.path.exists(logini):
         logging.config.fileConfig(logini)
-        
+
     files = find_tests(module_filter)
     files.sort()
 
@@ -800,7 +800,16 @@
         else:
             print "Running %s tests at level %d" % (kind, level)
 
-    warnings.filterwarnings("error")
+    # XXX We want to change *visible* warnings into errors.  The next
+    # line changes all warnings into errors, including warnings we
+    # normally never see.  In particular, test_datetime does some
+    # short-integer arithmetic that overflows to long ints, and, by
+    # default, Python doesn't display the overflow warning that can
+    # be enabled when this happens.  The next line turns that into an
+    # error instead.  Guido suggests that a better to get what we're
+    # after is to replace warnings.showwarning() with our own thing
+    # that raises an error.
+##    warnings.filterwarnings("error")
     warnings.filterwarnings("ignore", module="logging")
 
     if args: