Skip to content

Commit 143dabc

Browse files
committed
check step type first, it's less expensive
1 parent 5c02da2 commit 143dabc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pytest_bdd/scenario.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ def find_argumented_step_function(name: str, type_: str, fixturemanager: Fixture
4444
if step_func_context is None:
4545
continue
4646

47+
if step_func_context.type != type_:
48+
continue
49+
4750
match = step_func_context.parser.is_matching(name)
4851
if not match:
4952
continue
50-
if step_func_context.type != type_:
51-
continue
53+
5254
return step_func_context
5355
return None
5456

0 commit comments

Comments
 (0)