MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_enterContext

Method test_enterContext

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

Source from the content-addressed store, hash-verified

217
218
219 def test_enterContext(self):
220 class TestableTest(unittest.TestCase):
221 def testNothing(self):
222 pass
223
224 test = TestableTest('testNothing')
225 cleanups = []
226
227 test.addCleanup(cleanups.append, 'cleanup1')
228 cm = TestCM(cleanups, 42)
229 self.assertEqual(test.enterContext(cm), 42)
230 test.addCleanup(cleanups.append, 'cleanup2')
231
232 self.assertTrue(test.doCleanups())
233 self.assertEqual(cleanups, ['enter', 'cleanup2', 'exit', 'cleanup1'])
234
235 def test_enterContext_arg_errors(self):
236 class TestableTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

addCleanupMethod · 0.80
enterContextMethod · 0.80
assertTrueMethod · 0.80
doCleanupsMethod · 0.80
TestableTestClass · 0.70
TestCMClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected