diff --git a/tests/lib/when_steps.py b/tests/lib/when_steps.py index 5531d67c..660f7a28 100644 --- a/tests/lib/when_steps.py +++ b/tests/lib/when_steps.py @@ -32,7 +32,7 @@ all_input = '("(?P[^"]*)")' @when(re(f'we run "jrnl ?{command}" and {input_method} {all_input}')) @when(parse('we run "jrnl {command}"')) @when('we run "jrnl"') -def we_run_jrnl(cli_run, capsys, keyring, request, command, input_method, all_input): +def we_run_jrnl(capsys, keyring, request, command, input_method, all_input): from keyring import set_keyring set_keyring(keyring) @@ -42,6 +42,8 @@ def we_run_jrnl(cli_run, capsys, keyring, request, command, input_method, all_in inject_fixture(request, "input_method", input_method) inject_fixture(request, "all_input", all_input) + cli_run = request.getfixturevalue("cli_run") + with ExitStack() as stack: mocks = cli_run["mocks"] factories = cli_run["mock_factories"]