Add a function, with arguments, to be called when the test is completed. Functions added are called on a LIFO basis and are called after tearDown on test failure or success. Cleanup items are called even if setUp fails (unlike tearDown).
(self, function, /, *args, **kwargs)
| 470 | self._type_equality_funcs[typeobj] = function |
| 471 | |
| 472 | def addCleanup(self, function, /, *args, **kwargs): |
| 473 | """Add a function, with arguments, to be called when the test is |
| 474 | completed. Functions added are called on a LIFO basis and are |
| 475 | called after tearDown on test failure or success. |
| 476 | |
| 477 | Cleanup items are called even if setUp fails (unlike tearDown).""" |
| 478 | self._cleanups.append((function, args, kwargs)) |
| 479 | |
| 480 | def enterContext(self, cm): |
| 481 | """Enters the supplied context manager. |