MCPcopy Index your code
hub / github.com/python/cpython / test_setup_class

Method test_setup_class

Lib/test/test_unittest/test_setups.py:32–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30 return runner.run(realSuite)
31
32 def test_setup_class(self):
33 class Test(unittest.TestCase):
34 setUpCalled = 0
35 @classmethod
36 def setUpClass(cls):
37 Test.setUpCalled += 1
38 unittest.TestCase.setUpClass()
39 def test_one(self):
40 pass
41 def test_two(self):
42 pass
43
44 result = self.runTests(Test)
45
46 self.assertEqual(Test.setUpCalled, 1)
47 self.assertEqual(result.testsRun, 2)
48 self.assertEqual(len(result.errors), 0)
49
50 def test_teardown_class(self):
51 class Test(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

runTestsMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected