def METHOD_NAME(request):
    yield
    user_properties = getattr(request.node, 'user_properties')
    # Check if there was a restart
    if len(user_properties) > 4 and user_properties[4][1]:
        active = False
        api_details = getattr(request.module, 'api_details')
        while not active:
            try:
                status = None
                status = requests.get(api_details['base_url'], headers=api_details['auth_headers'],
                                      verify=False).status_code
            except Exception:
                pass
            finally:
                if status == 200:
                    active = True
                else:
                    sleep(5)