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

Method test_skip_class

Lib/test/test_unittest/test_skipping.py:126–148  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

124 self.assertEqual(result.skipped, [])
125
126 def test_skip_class(self):
127 @unittest.skip("testing")
128 class Foo(unittest.TestCase):
129 def defaultTestResult(self):
130 return LoggingResult(events)
131 def test_1(self):
132 record.append(1)
133 events = []
134 record = []
135 result = LoggingResult(events)
136 test = Foo("test_1")
137 suite = unittest.TestSuite([test])
138 self.assertIs(suite.run(result), result)
139 self.assertEqual(events, ['startTest', 'addSkip', 'stopTest'])
140 self.assertEqual(result.skipped, [(test, "testing")])
141 self.assertEqual(record, [])
142
143 events = []
144 result = test.run()
145 self.assertEqual(events, ['startTestRun', 'startTest', 'addSkip',
146 'stopTest', 'stopTestRun'])
147 self.assertEqual(result.skipped, [(test, "testing")])
148 self.assertEqual(record, [])
149
150 def test_skip_non_unittest_class(self):
151 @unittest.skip("testing")

Callers

nothing calls this directly

Calls 6

runMethod · 0.95
runMethod · 0.95
LoggingResultClass · 0.90
FooClass · 0.70
assertIsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected