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

Barry Warsaw barry@wooz.org
Tue, 24 Dec 2002 11:18:05 -0500


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

Modified Files:
      Tag: NameGeddon-branch
	test.py 
Log Message:
visit(), get_suite(): RuntimeErrors are used in both the package
import and the test module import to signal missing optional
software.  Such tests are skipped and in verbose mode a message is
printed.

Coming up, patches to tests modules...


=== Zope3/test.py 1.33.2.1 => 1.33.2.2 ===
--- Zope3/test.py:1.33.2.1	Mon Dec 23 14:39:27 2002
+++ Zope3/test.py	Tue Dec 24 11:18:05 2002
@@ -307,7 +307,7 @@
             __import__(pkg)
         # We specifically do not want to catch ImportError since that's useful
         # information to know when running the tests.
-        except Exception, e:
+        except RuntimeError, e:
             if VERBOSE:
                 print 'skipping', pkg, 'because:', e
             return
@@ -346,6 +346,11 @@
     modname = finder.module_from_path(file)
     try:
         mod = package_import(modname)
+    except RuntimeError:
+        # test uses some optional software
+        if VERBOSE:
+            print 'Module with missing optional software skipped:', modname
+        return None
     except ImportError, err:
         # print traceback
         print "Error importing %s\n%s" % (modname, err)