From 51f8ef54bb7df34a449d709f081223cff3523658 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Mon, 20 Feb 2023 12:22:22 -0800 Subject: [PATCH] Prevent greedy matching in "we run" by using regular expression lookahead --- tests/lib/when_steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/when_steps.py b/tests/lib/when_steps.py index 660f7a28..71252f86 100644 --- a/tests/lib/when_steps.py +++ b/tests/lib/when_steps.py @@ -30,7 +30,7 @@ all_input = '("(?P[^"]*)")' @when(parse('we run "jrnl {command}" and {input_method}\n{all_input}')) @when(re(f'we run "jrnl ?{command}" and {input_method} {all_input}')) -@when(parse('we run "jrnl {command}"')) +@when(re(f'we run "jrnl {command}"(?! and)')) @when('we run "jrnl"') def we_run_jrnl(capsys, keyring, request, command, input_method, all_input): from keyring import set_keyring