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)
| 463 | self._type_equality_funcs[typeobj] = function |
| 464 | |
| 465 | def addCleanup(self, function, /, *args, **kwargs): |
| 466 | """Add a function, with arguments, to be called when the test is |
| 467 | completed. Functions added are called on a LIFO basis and are |
| 468 | called after tearDown on test failure or success. |
| 469 | |
| 470 | Cleanup items are called even if setUp fails (unlike tearDown).""" |
| 471 | self._cleanups.append((function, args, kwargs)) |
| 472 | |
| 473 | def enterContext(self, cm): |
| 474 | """Enters the supplied context manager. |