

def inject_fixture(request, arg, value):
    'Inject fixture into pytest fixture request.\n\n    :param request: pytest fixture request\n    :param arg: argument name\n    :param value: argument value\n    '
    fd = python.FixtureDef(fixturemanager=request._fixturemanager, baseid=None, argname=arg, func=(lambda : value), scope='function', params=None, yieldctx=False)
    fd.cached_result = (value, 0, None)
    old_fd = getattr(request, '_fixturedefs', {
        
    }).get(arg)
    old_value = request._funcargs.get(arg)
    add_fixturename = (arg not in request.fixturenames)

    def fin():
        request._fixturemanager._arg2fixturedefs[arg].remove(fd)
        getattr(request, '_fixturedefs', {
            
        })[arg] = old_fd
        request._funcargs[arg] = old_value
        if add_fixturename:
            request.fixturenames.remove(arg)
    request.addfinalizer(fin)
    request._fixturemanager._arg2fixturedefs.setdefault(arg, []).insert(0, fd)
    getattr(request, '_fixturedefs', {
        
    })[arg] = fd
    request._funcargs[request] = value
    if add_fixturename:
        request.fixturenames.append(arg)

dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/steps.py inject_fixture/VarMisuse@223/352 `arg`->`request`