Skip to content

Commit 9061c6d

Browse files
committed
use original variable name, remove TODO
1 parent 1c6a2b3 commit 9061c6d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pytest_bdd/steps.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,17 @@ def _step_decorator(
125125
converters = {}
126126

127127
def decorator(func: TCallable) -> TCallable:
128-
step_func = func
129128
parser_instance = get_parser(step_name)
130129
parsed_step_name = parser_instance.name
131130

132-
# TODO: Try to not attach to both step_func and lazy_step_func
133-
134131
def lazy_step_func() -> TCallable:
135-
return step_func
132+
return func
136133

137134
lazy_step_func._pytest_bdd_parser = parser_instance
138135

139-
setdefault(step_func, "_pytest_bdd_parsers", []).append(parser_instance)
140-
step_func._pytest_bdd_converters = converters
141-
step_func._pytest_bdd_target_fixture = target_fixture
136+
setdefault(func, "_pytest_bdd_parsers", []).append(parser_instance)
137+
func._pytest_bdd_converters = converters
138+
func._pytest_bdd_target_fixture = target_fixture
142139

143140
fixture_step_name = get_step_fixture_name(parsed_step_name, step_type)
144141

0 commit comments

Comments
 (0)