lundi 30 mai 2016

addCleanUp vs tearDown

Recently, Ned Batchelder during his talk at PyCon 2016 noted:

If you are using unittest to write your tests, definitely use addCleanup, it's much better than tearDown.

Up until now, I've never used addCleanUp() and got used to setUp()/tearDown() pair of methods for test "set up" and "tear down" phases.

Why should I switch to addCleanUp() instead of tearDown()?

Aucun commentaire:

Enregistrer un commentaire