Execute all module cleanup functions. Normally called for you after tearDownModule.
()
| 144 | |
| 145 | |
| 146 | def doModuleCleanups(): |
| 147 | """Execute all module cleanup functions. Normally called for you after |
| 148 | tearDownModule.""" |
| 149 | exceptions = [] |
| 150 | while _module_cleanups: |
| 151 | function, args, kwargs = _module_cleanups.pop() |
| 152 | try: |
| 153 | function(*args, **kwargs) |
| 154 | except Exception as exc: |
| 155 | exceptions.append(exc) |
| 156 | if exceptions: |
| 157 | # Swallows all but first exception. If a multi-exception handler |
| 158 | # gets written we should use that here instead. |
| 159 | raise exceptions[0] |
| 160 | |
| 161 | |
| 162 | def skip(reason): |