def given(name, fixture=None, converters=None, scope='function', target_fixture=None):
    if fixture is not None:
        module = get_caller_module()

        def step_func(request):
            return request.getfuncargvalue(fixture)

        step_func.step_type = GIVEN
        step_func.converters = converters
        step_func.__name__ = name
        step_func.fixture = fixture
        func = pytest.fixture(scope=scope)(lambda: step_func)
        func.__doc__ = 'Alias for the "{0}" fixture.'.format(fixture)
        _, name = parse_line(name)
        contribute_to_module(module, get_step_fixture_name(name, GIVEN), func)
        return _not_a_fixture_decorator

    return _step_decorator(GIVEN, name, converters=converters, scope=scope, target_fixture=target_fixture)
Given step decorator.
dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/steps.py/given