Recently, Ned Batchelder during his talk at PyCon 2016 noted:
If you are using
unittestto write your tests, definitely useaddCleanup, it's much better thantearDown.
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