Changeset 91

Show
Ignore:
Timestamp:
Thu Aug 24 19:28:36 2006
Author:
jpellerin
Message:

r3542@Jason-Pellerins-Computer: jhp | 2006-08-24 19:28:32 -0500
Fixed #83: test runs with --stop option no longer stop on skip or deprecated tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/unit_tests/test_result.py

    r62 r91  
    52 52                          (test, tr._exc_info_to_string(err, test), ''))  
    53 53         self.assertEqual(buf, [ 'ERROR' ])  
    54            
      54  
    54 54         # test with capture  
    55 55         start_capture()  
     
    74 74         self.assertEqual(len(tr.errors), 2)  
    75 75         self.assertEqual(tr.deprecated, [ (test, '', '') ])  
    76            
      76  
    76 76         # test skip  
    77 77         try:  
     
    83 83         self.assertEqual(len(tr.errors), 2)  
    84 84         self.assertEqual(tr.skip, [ (test, '', '') ])  
    85    
    86 85         self.assertEqual(buf, ['ERROR', 'ERROR', 'DEPRECATED', 'SKIP'])  
    87 86          
     
    123 122             raise Exception("oh no!")  
    124 123         except:  
    125               err = sys.exc_info()             
      124             err = sys.exc_info()  
    125 124         test = self.T()  
    126 125         tr.addError(test, err)         
    127 126         assert tr.shouldStop  
    128 127  
      128     def test_stop_on_error_skip(self):  
      129         buf, tr = self.buf, self.tr  
      130         tr.conf.stopOnError = True  
      131         try:  
      132             raise SkipTest("oh no!")  
      133         except:  
      134             err = sys.exc_info()  
      135         test = self.T()  
      136         tr.addError(test, err)         
      137         assert not tr.shouldStop  
      138  
      139     def test_stop_on_error_deprecated(self):  
      140         buf, tr = self.buf, self.tr  
      141         tr.conf.stopOnError = True  
      142         try:  
      143             raise DeprecatedTest("oh no!")  
      144         except:  
      145             err = sys.exc_info()  
      146         test = self.T()  
      147         tr.addError(test, err)         
      148         assert not tr.shouldStop  
      149          
    129 150     def test_stop_on_error_fail(self):  
    130 151         buf, tr = self.buf, self.tr  
  • trunk/nose/result.py

    r83 r91  
    51 51             call_plugins(self.conf.plugins, 'addError',  
    52 52                          test, err, self.capt)  
    53           if self.conf.stopOnError:  
    54               self.shouldStop = True  
      53             if self.conf.stopOnError:  
      54                 self.shouldStop = True  
    55 55              
    56 56     def addFailure(self, test, err):