mailRe: r3257 - /1.3/test_suite/unit_tests/unit_test_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on April 12, 2007 - 09:25:
Sorry about the 12 day late response!  I think that the
ExtendedException class would be better served with a RelaxError.  The
class could be moved into the 'relax_errors' module and the
'***WARNING:' part of the string dropped.  This would bring the
exception into the standard relax system without affecting the unit
test runner.  Gary, what do you think of the idea?

Cheers,

Edward


On 3/31/07, garyt@xxxxxxxxxxxxxxx <garyt@xxxxxxxxxxxxxxx> wrote:
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




Related Messages


Powered by MHonArc, Updated Thu Apr 12 19:00:44 2007