views:

113

answers:

1

Is there a difference between using tearDown and setUp versus init and del when using the pyUnit testing framework? If so, what is it exactly and what is the preferred method of use?

Thanks.

+5  A: 

setUp is called before every test, and tearDown is called after every test. __init__ is called only once when the class is instantiated. You generally do not need to define __init__ or __del__ when writing unit tests.

unutbu