mailr12096 - /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 on January 03, 2011 - 20:23:
Author: bugman
Date: Mon Jan  3 20:23:55 2011
New Revision: 12096

URL: http://svn.gna.org/viewcvs/relax?rev=12096&view=rev
Log:
Fix for load_test_case() for a bug introduced in r12095.

The import errro test case was not handled correctly.


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=12096&r1=12095&r2=12096&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/unit_test_runner.py (original)
+++ 1.3/test_suite/unit_tests/unit_test_runner.py Mon Jan  3 20:23:55 2011
@@ -291,16 +291,20 @@
     """
 
     # Determine the full name of the module.
-    print package_path
     module = get_module_relative_path(package_path, module_name)
 
     # Catch import errors, adding the ImportErrorTestCase class to the test 
suite.
     try:
         packages = import_module(module)
     except:
-        result = unittest.TestSuite()
-        bad_syntax = ImportErrorTestCase(module, traceback.format_exc())
-        result.addTest(bad_syntax)
+        # Initialise a test suite.
+        suite = unittest.TestSuite()
+
+        # Add the ImportErrorTestCase.
+        suite.addTest(ImportErrorTestCase(module, traceback.format_exc()))
+
+        # Return the suite.
+        return suite
 
     # Nothing to do.
     if not packages:
@@ -653,19 +657,15 @@
 
 
     def run(self, runner=None):
-        '''Run a unit test or set of unit tests.
-
-        @keyword runner:    A unit test runner such as TextTestRunner.  None 
indicates use of the
-                            default unit test runner for an example of how 
to write a test runner
-                            see the python documentation for TextTestRunner 
in the python source.
+        """Run a unit test or set of unit tests.
+
+        @keyword runner:    A unit test runner such as TextTestRunner.  None 
indicates use of the default unit test runner.  For an example of how to 
write a test runner see the python documentation for TextTestRunner in the 
python source.
         @type runner:       Unit test runner instance (TextTestRunner, 
BaseGUITestRunner subclass, etc.)
         @return:            A string indicating success or failure of the 
unit tests run.
         @rtype:             str
-        '''
-
-        msg = ''' Either set self.%s to a %s directory or set 
search_for_%s_path in
-                  self.__init__ to True'''
-        msg=dedent(msg)
+        """
+
+        msg = "Either set self.%s to a %s directory or set 
search_for_%s_path in self.__init__ to True"
         if self.unit_test_directory ==  None:
             raise Exception(msg % ('unit_test_directory', 'unit test', 
'unit_test'))
         if self.system_directory == None:




Related Messages


Powered by MHonArc, Updated Mon Jan 03 20:40:01 2011