def METHOD_NAME(client):
    key_info = {
        "description": "test",
        "actions": ["search"],
        "indexes": ["movies"],
        "expiresAt": None,
    }
    key = client.create_key(key_info)
    yield key
    try:
        client.delete_key(key.key)
    except MeilisearchApiError:
        pass