ID EN
Unittest

addCleanup

Python 3.11

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.

Syntax

PYTHON
addCleanup(function, /, *args, **kwargs)

See Also

tearDown() addCleanup() setUp() tearDown()