def test_user_mode_shall_restore_behave_mode_if_exception_is_raised(self):
        initial_mode = runner.Context.BEHAVE
        eq_(self.context._mode, initial_mode)
        try:
            with self.context.user_mode():
                eq_(self.context._mode, runner.Context.USER)
                raise RuntimeError("XFAIL")
        except __HOLE__:
            eq_(self.context._mode, initial_mode)
dataset/ETHPy150Open behave/behave/test/test_runner.py/TestContext.test_user_mode_shall_restore_behave_mode_if_exception_is_raised