PyDocs

Nav

Development Tools

TestCase.addCleanup

unittest

method of TestCase · Added in 3.1 (source)
  • TestCase.addCleanup(function, /, *args, **kwargs)
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).
0 Examples
No examples for unittest/TestCase.addCleanup.
See Also
No see-alsos for unittest/TestCase.addCleanup
0 Notes
No notes for TestCase.addCleanup