diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index f6d8e5360..94f7a9367 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -53,6 +53,13 @@ def run_command_given(quteproc, command): quteproc.send_cmd(command) +@bdd.given("I have a fresh instance") +def fresh_instance(quteproc): + """Restart qutebrowser instance for tests needing a fresh state.""" + quteproc.terminate() + quteproc.start() + + @bdd.when(bdd.parsers.parse("I run {command}")) def run_command_when(quteproc, httpbin, command): command = command.replace('(port)', str(httpbin.port))