cannot run TestCase with more than 1 test method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Invalid
|
Undecided
|
Unassigned |
Bug Description
After upgrading from 0.9.34 to 0.9.36, I am no longer able to run any TestCases that have more than one test method in them. The issue derives from the following change to testtools:
https:/
I see testtools.
"TestCase.setUp was already called. Do not explicitly call setUp from your tests. In your own setUp, use super to call the base setUp."
The expectation that setUp() is called only once per TestCase seems incorrect. Setup and teardown will get called multiple times, flanking each test method in the TestCase.
Looking at the code change for testtools.TestCase (link above) I would expect self.__setup_called to be reset to False in the tearDown method.
Starting with testtools 0.9.34 I can cause the bug to happen if I introduce the code change linked in the bug description and I can fix the behaviour by setting self.__setup_called to false in testtools. TestCase. tearDown