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