| 746 | self.assertIsNone(exc) |
| 747 | self.assertIsNone(exc_tb) |
| 748 | class ExitCM(object): |
| 749 | def __init__(self, check_exc): |
| 750 | self.check_exc = check_exc |
| 751 | def __enter__(self): |
| 752 | self.fail("Should not be called!") |
| 753 | def __exit__(self, *exc_details): |
| 754 | self.check_exc(*exc_details) |
| 755 | with self.exit_stack() as stack: |
| 756 | stack.push(_expect_ok) |
| 757 | self.assertIs(stack._exit_callbacks[-1][1], _expect_ok) |