MCPcopy Create free account
hub / github.com/python/cpython / test_addTest__TestCase

Method test_addTest__TestCase

Lib/test/test_unittest/test_suite.py:236–249  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

234
235 # "Add a TestCase ... to the suite"
236 def test_addTest__TestCase(self):
237 class Foo(unittest.TestCase):
238 def test(self): pass
239
240 test = Foo('test')
241 suite = unittest.TestSuite()
242
243 suite.addTest(test)
244
245 self.assertEqual(suite.countTestCases(), 1)
246 self.assertEqual(list(suite), [test])
247 # countTestCases() still works after tests are run
248 suite.run(unittest.TestResult())
249 self.assertEqual(suite.countTestCases(), 1)
250
251 # "Add a ... TestSuite to the suite"
252 def test_addTest__TestSuite(self):

Callers

nothing calls this directly

Calls 6

runMethod · 0.95
listClass · 0.85
addTestMethod · 0.80
FooClass · 0.70
assertEqualMethod · 0.45
countTestCasesMethod · 0.45

Tested by

no test coverage detected