Recently, Ned Batchelder during his talk at PyCon 2016 noted:
If you are using unittest to write your tests, definitely use addCleanu
unittest
addCleanu
addCleanup() methods will run even if one of them fails, and will run even if setUp() fails. You should also consider using pytest.
addCleanup()
setUp()