Author rtarpine
Recipients rtarpine
Date 2021-04-22.17:30:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Functions registered with unittest.addModuleCleanup are not called unless the user defines tearDownModule in their test module.

This behavior is unexpected because functions registered with TestCase.addClassCleanup are called even the user doesn't define tearDownClass, and similarly with addCleanup/tearDown.

The implementing code is basically the same for all 3 cases, the difference is that unittest.TestCase itself defines tearDown and tearDownClass; so even though doClassCleanups is only called if tearDownClass is defined, in practice it always is.

doModuleCleanups should be called even if tearDownModule is not defined.
Date User Action Args
2021-04-22 17:30:03rtarpinesetrecipients: + rtarpine
2021-04-22 17:30:03rtarpinesetmessageid: <>
2021-04-22 17:30:03rtarpinelinkissue43913 messages
2021-04-22 17:30:03rtarpinecreate