Better import error messages in test.py
authorW. Trevor King <wking@drexel.edu>
Thu, 31 Dec 2009 17:36:29 +0000 (12:36 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 31 Dec 2009 17:36:29 +0000 (12:36 -0500)
test.py

diff --git a/test.py b/test.py
index 29dece6a0ac7303618cfac0b45f155c63acf0ef9..f26aaa8a86bbc5c9495d4eec568c2769d4168be7 100644 (file)
--- a/test.py
+++ b/test.py
@@ -52,7 +52,11 @@ def python_tree(root_path='libbe', root_modname='libbe'):
     return tree
 
 def add_module_tests(suite, modname):
-    mod = import_by_name(modname)
+    try:
+        mod = import_by_name(modname)
+    except ValueError, e:
+        print >> sys.stderr, 'Failed to import "%s"' % (modname)
+        raise e
     if hasattr(mod, 'suite'):
         s = mod.suite
     else: