def METHOD_NAME(arg, env, expected):
    if env:
        os.environ['BMP_GDB_SERIAL'] = env
    else:
        if 'BMP_GDB_SERIAL' in os.environ:
            os.environ.pop('BMP_GDB_SERIAL')
    ret = blackmagicprobe.blackmagicprobe_gdb_serial(arg)
    assert expected == ret