Re: [Tutor] Please help understanding unittest fixtures

2011-08-22 Thread Peter Otten
Steven D'Aprano wrote: > D. Guandalino wrote: >> In this case is there a >> way to force just one setUp() call? > > > I don't know if this is the best way, but the first way that comes to > mind is this: > > > class C(TestCase): > initialised = False > def setUp(self): > if

Re: [Tutor] Please help understanding unittest fixtures

2011-08-21 Thread Steven D'Aprano
D. Guandalino wrote: 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 i

[Tutor] Please help understanding unittest fixtures

2011-08-21 Thread D. Guandalino
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 TestCas