[Tutor] Please help understanding unittest fixtures
D. Guandalino
guandalino at gmail.com
Mon Aug 22 00:15:02 CEST 2011
Suppose I have this TestCase class.
class C(TestCase):
def setUp():
# very time consuming and resources intensive stuffs.
pass
def test_A(self):
pass
def test_B(self):
pass
def test_C(self):
pass
The unittest docs says:
> Each instance of the TestCase will only be used to run a single test
> method, so a new fixture is created for each test.
Does this mean that the setUp() method, which is called to prepare the test
fixture, get called for test_A, test_B and test_C? In this case is there a
way to force just one setUp() call?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110822/61800d7a/attachment-0001.html>
More information about the Tutor
mailing list