def METHOD_NAME(val_volt):
    keysight_sim = Keysight_34465A(
        "keysight_34465A_sim",
        address="GPIB::1::INSTR",
        pyvisa_sim_file="Keysight_34465A.yaml",
    )
    def get_ask_with_read_mock(original_ask, read_value):
        def ask_with_read_mock(cmd: str) -> str:
            if cmd in ("READ?", "FETCH?"):
                return read_value
            else:
                return original_ask(cmd)
        return ask_with_read_mock
    keysight_sim.ask = get_ask_with_read_mock(keysight_sim.ask, val_volt)
    try:
        yield keysight_sim
    finally:
        Keysight_34465A.close_all()