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

Method test_teardown_class

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

Source from the content-addressed store, hash-verified

48 self.assertEqual(len(result.errors), 0)
49
50 def test_teardown_class(self):
51 class Test(unittest.TestCase):
52 tearDownCalled = 0
53 @classmethod
54 def tearDownClass(cls):
55 Test.tearDownCalled += 1
56 unittest.TestCase.tearDownClass()
57 def test_one(self):
58 pass
59 def test_two(self):
60 pass
61
62 result = self.runTests(Test)
63
64 self.assertEqual(Test.tearDownCalled, 1)
65 self.assertEqual(result.testsRun, 2)
66 self.assertEqual(len(result.errors), 0)
67
68 def test_teardown_class_two_classes(self):
69 class Test(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

runTestsMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected