def METHOD_NAME(request, register_agent):
    """Configure a custom environment for testing."""
    new_agent_group()
    agent_id = getattr(request.module, 'response_data')['id']
    sb.run([f"{tools.WAZUH_PATH}/bin/agent_groups", "-q", "-a", "-i", agent_id, "-g", 'default'])
    sb.run([f"{tools.WAZUH_PATH}/bin/agent_groups", "-q", "-a", "-i", agent_id, "-g", DEFAULT_TESTING_GROUP_NAME])
    yield
    remove_agent_group(DEFAULT_TESTING_GROUP_NAME)
    delete_file(os.path.join(groups_folder, agent_id))