def test_exec_wrapper(self):
    'Check that the wrapper permits exceptions.'
    wrapper = tools.ContextManagerWrapper(self.DummyClass())
    self.assertFalse(wrapper.closed)
    with self.assertRaisesRegex(ZeroDivisionError, '(integer division or modulo by zero|division by zero)'):
        with wrapper:
            (1 / 0)
    self.assertTrue(wrapper.closed)
Check that the wrapper permits exceptions.
def test_exec_wrapper(self):
    
    wrapper = tools.ContextManagerWrapper(self.DummyClass())
    self.assertFalse(wrapper.closed)
    with self.assertRaisesRegex(ZeroDivisionError, '(integer division or modulo by zero|division by zero)'):
        with wrapper:
            (1 / 0)
    self.assertTrue(wrapper.closed)