Running nosetests -s
for
class TestTemp():
def __init__(self):
print \'__init__\'
self.even = 0
def setup(self):
Yes, you are supposed to create a clean slate for the tests, and keep your individual tests isolated.
It appears the test instances (one per test) are created in one batch, while setup
is called right before each test. If your setup needs to reset external state, you'll need to do this in setup
; if you were to do this in __init__
individual tests can screw up that external state for the rest of the test run.