(self)
| 1098 | stack.callback(int) |
| 1099 | |
| 1100 | def test_instance_bypass(self): |
| 1101 | class Example(object): pass |
| 1102 | cm = Example() |
| 1103 | cm.__enter__ = object() |
| 1104 | cm.__exit__ = object() |
| 1105 | stack = self.exit_stack() |
| 1106 | with self.assertRaisesRegex(TypeError, 'the context manager'): |
| 1107 | stack.enter_context(cm) |
| 1108 | stack.push(cm) |
| 1109 | self.assertIs(stack._exit_callbacks[-1][1], cm) |
| 1110 | |
| 1111 | def test_dont_reraise_RuntimeError(self): |
| 1112 | # https://bugs.python.org/issue27122 |
nothing calls this directly
no test coverage detected