Per the addCleanup
doc string:
Cleanup items are called even if setUp fails (unlike tearDown)
addCleanup
can be used to register multiple functions, so you could use
separate functions for each resource you wish to clean up. That would allow your
code to be a bit more reusable/modular.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…