Execute all cleanup functions. Normally called for you after tearDown.
(self)
| 702 | stopTestRun() |
| 703 | |
| 704 | def doCleanups(self): |
| 705 | """Execute all cleanup functions. Normally called for you after |
| 706 | tearDown.""" |
| 707 | outcome = self._outcome or _Outcome() |
| 708 | while self._cleanups: |
| 709 | function, args, kwargs = self._cleanups.pop() |
| 710 | with outcome.testPartExecutor(self): |
| 711 | self._callCleanup(function, *args, **kwargs) |
| 712 | |
| 713 | # return this for backwards compatibility |
| 714 | # even though we no longer use it internally |
| 715 | return outcome.success |
| 716 | |
| 717 | @classmethod |
| 718 | def doClassCleanups(cls): |