[Python-checkins] r81878 - in python/trunk/Lib/unittest: suite.py test/test_setups.py

michael.foord python-checkins at python.org
Thu Jun 10 22:40:21 CEST 2010


Author: michael.foord
Date: Thu Jun 10 22:40:21 2010
New Revision: 81878

Log:
Fix issue with nested test suites debug method and module setups. (unittest)


Modified:
   python/trunk/Lib/unittest/suite.py
   python/trunk/Lib/unittest/test/test_setups.py

Modified: python/trunk/Lib/unittest/suite.py
==============================================================================
--- python/trunk/Lib/unittest/suite.py	(original)
+++ python/trunk/Lib/unittest/suite.py	Thu Jun 10 22:40:21 2010
@@ -112,7 +112,7 @@
                     continue
 
             if hasattr(test, '_wrapped_run'):
-                test._wrapped_run(result)
+                test._wrapped_run(result, debug)
             elif not debug:
                 test(result)
             else:

Modified: python/trunk/Lib/unittest/test/test_setups.py
==============================================================================
--- python/trunk/Lib/unittest/test/test_setups.py	(original)
+++ python/trunk/Lib/unittest/test/test_setups.py	Thu Jun 10 22:40:21 2010
@@ -495,7 +495,9 @@
         Test.__module__ = 'Module'
         sys.modules['Module'] = Module
 
-        suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
+        _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
+        suite = unittest.TestSuite()
+        suite.addTest(_suite)
 
         messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something')
         for phase, msg in enumerate(messages):


More information about the Python-checkins mailing list