def _step_decorator(step_type, step_name, converters=None, scope='function', target_fixture=None):
    def decorator(func):
        step_func = func
        parser_instance = get_parser(step_name)
        parsed_step_name = parser_instance.name

        if step_type == GIVEN:
            if not hasattr(func, "_pytestfixturefunction"):
                # Avoid multiple wrapping of a fixture
                func = pytest.fixture(scope=scope)(func)

            def step_func(request):
                result = request.getfuncargvalue(func.__name__)
                if target_fixture:
                    inject_fixture(request, target_fixture, result)
                return result

            step_func.__doc__ = func.__doc__
            step_func.fixture = func.__name__

        step_func.__name__ = force_encode(parsed_step_name)

        @pytest.fixture(scope=scope)
        def lazy_step_func():
            return step_func

        step_func.step_type = step_type

        lazy_step_func = contribute_to_module(
            get_caller_module(), get_step_fixture_name(parsed_step_name, step_type), lazy_step_func)

        lazy_step_func.step_type = step_type

        # Preserve the docstring
        lazy_step_func.__doc__ = func.__doc__

        step_func.parser = lazy_step_func.parser = parser_instance
        if converters:
            step_func.converters = lazy_step_func.converters = converters

        return func

    return decorator
Step decorator for the type and the name.
dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/steps.py/_step_decorator