| 100 | """ |
| 101 | |
| 102 | def run(self, result, debug=False): |
| 103 | topLevel = False |
| 104 | if getattr(result, '_testRunEntered', False) is False: |
| 105 | result._testRunEntered = topLevel = True |
| 106 | |
| 107 | for index, test in enumerate(self): |
| 108 | if result.shouldStop: |
| 109 | break |
| 110 | |
| 111 | if _isnotsuite(test): |
| 112 | self._tearDownPreviousClass(test, result) |
| 113 | self._handleModuleFixture(test, result) |
| 114 | self._handleClassSetUp(test, result) |
| 115 | result._previousTestClass = test.__class__ |
| 116 | |
| 117 | if (getattr(test.__class__, '_classSetupFailed', False) or |
| 118 | getattr(result, '_moduleSetUpFailed', False)): |
| 119 | continue |
| 120 | |
| 121 | if not debug: |
| 122 | test(result) |
| 123 | else: |
| 124 | test.debug() |
| 125 | |
| 126 | if self._cleanup: |
| 127 | self._removeTestAtIndex(index) |
| 128 | |
| 129 | if topLevel: |
| 130 | self._tearDownPreviousClass(None, result) |
| 131 | self._handleModuleTearDown(result) |
| 132 | result._testRunEntered = False |
| 133 | return result |
| 134 | |
| 135 | def debug(self): |
| 136 | """Run the tests without collecting errors in a TestResult""" |