Author: varioustoxins
Date: Fri Mar 30 16:11:44 2007
New Revision: 3257
URL: http://svn.gna.org/viewcvs/relax?rev=3257&view=rev
Log:
unit_test_runner emits a better warning messages that no tests from
a module with a syntax error will be run
Modified:
1.3/test_suite/unit_tests/unit_test_runner.py
Modified: 1.3/test_suite/unit_tests/unit_test_runner.py
URL:
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/unit_test_runner.py?rev=3257&r1=3256&r2=3257&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/unit_test_runner.py (original)
+++ 1.3/test_suite/unit_tests/unit_test_runner.py Fri Mar 30 16:11:44 2007
@@ -249,6 +249,15 @@
return result
+class ExtendedException(Exception):
+ def __init__(self,e,module):
+ self.e=e
+ self.module=module
+ def __str__(self):
+ result = self.e.__str__()
+ result = result + '\n\n***WARNING: no tests from module %s will be
run!!!' % self.module
+ return result
+
class ImportErrorTestCase(unittest.TestCase):
def __init__(self,module_name,syntax_error):
super(ImportErrorTestCase,self).__init__('testImportError')
@@ -288,7 +297,8 @@
# result.addTest(bad_syntax)
except Exception,e:
result = unittest.TestSuite()
- bad_syntax = ImportErrorTestCase('testImportError',e)
+ ee = ExtendedException(e,module_name)
+ bad_syntax = ImportErrorTestCase('testImportError',ee)
result.addTest(bad_syntax)
@@ -396,6 +406,7 @@
module_path = get_module_relative_path(dir_path,
module_found)
+ #FIXME add verbose search option
#if self.verbose:
# print 'loading module: ' + module_path
_______________________________________________
relax (http://nmr-relax.com)
This is the relax-commits mailing list
relax-commits@xxxxxxx
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits