unittest.TestCase.addCleanup()

addCleanup(function, *args, **kwargs)

Add a function to be called after tearDown() to cleanup resources used during the test. Functions will be called in reverse order to the order they are added (LIFO). They are called with any arguments and keyword arguments passed into addCleanup() when they are added.

If setUp() fails, meaning that tearDown() is not called, then any cleanup functions added will still be called.

New in version 3.1.

doc_python
2016-10-07 17:46:17
Comments
Leave a Comment

Please login to continue.