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

Method test_run_nested_test

Lib/test/test_unittest/test_runner.py:569–594  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

567 self.assertEqual(TestableTest._class_cleanups, [])
568
569 def test_run_nested_test(self):
570 ordering = []
571
572 class InnerTest(unittest.TestCase):
573 @classmethod
574 def setUpClass(cls):
575 ordering.append('inner setup')
576 cls.addClassCleanup(ordering.append, 'inner cleanup')
577 def test(self):
578 ordering.append('inner test')
579
580 class OuterTest(unittest.TestCase):
581 @classmethod
582 def setUpClass(cls):
583 ordering.append('outer setup')
584 cls.addClassCleanup(ordering.append, 'outer cleanup')
585 def test(self):
586 ordering.append('start outer test')
587 runTests(InnerTest)
588 ordering.append('end outer test')
589
590 runTests(OuterTest)
591 self.assertEqual(ordering, [
592 'outer setup', 'start outer test',
593 'inner setup', 'inner test', 'inner cleanup',
594 'end outer test', 'outer cleanup'])
595
596 def test_run_empty_suite_error_message(self):
597 class EmptyTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

runTestsFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected