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

Matthew T. Kromer matt@zope.com
Mon, 26 Nov 2001 13:15:10 -0500


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

Modified Files:
	testrunner.py 
Log Message:
Updated testrunner to be more explicit about errors when modules do not import


=== Zope/utilities/testrunner.py 1.20 => 1.21 ===
         try:
             sys.path.append(path)       # let module find things in its dir
-            module=imp.load_module(name, file, pathname, desc)
+	    try:
+            	module=imp.load_module(name, file, pathname, desc)
+	    except:
+	    	(tb_t, tb_v, tb_tb) = sys.exc_info()
+		self.report("Module %s failed to load\n%s: %s" % (pathname,
+			tb_t, tb_v))
+		self.report(join( traceback.format_tb(tb_tb)) + '\n')
+		del tb_tb
         finally:
             file.close()
             sys.path.pop()              # Remove module level path