def test_use_with_behave_mode__shall_restore_initial_mode_with_error(self):
        # -- CASE: Exception is raised.
        # pylint: disable=protected-access
        initial_mode = runner.Context.USER
        self.context._mode = initial_mode
        try:
            with self.context._use_with_behave_mode():
                eq_(self.context._mode, runner.Context.BEHAVE)
                raise RuntimeError("XFAIL")
        except __HOLE__:
            eq_(self.context._mode, initial_mode)
dataset/ETHPy150Open behave/behave/test/test_runner.py/TestContext.test_use_with_behave_mode__shall_restore_initial_mode_with_error