(self)
| 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): |
nothing calls this directly
no test coverage detected