Remove requests_cache in tests (#5285)

This commit is contained in:
Silvano Cerza 2023-07-06 13:22:52 +02:00 committed by GitHub
parent ad6072728d
commit a1a390056a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
import warnings import warnings
from datetime import timedelta
from typing import Any, List, Optional, Dict, Union from typing import Any, List, Optional, Dict, Union
import gc import gc
@ -10,7 +9,6 @@ import re
from functools import wraps from functools import wraps
from unittest.mock import patch from unittest.mock import patch
import requests_cache
import responses import responses
import posthog import posthog
@ -81,10 +79,6 @@ posthog.disabled = True
# Disable caching from prompthub to avoid polluting the local environment. # Disable caching from prompthub to avoid polluting the local environment.
os.environ["PROMPTHUB_CACHE_ENABLED"] = "false" os.environ["PROMPTHUB_CACHE_ENABLED"] = "false"
# Cache requests (e.g. huggingface model) to circumvent load protection
# See https://requests-cache.readthedocs.io/en/stable/user_guide/filtering.html
requests_cache.install_cache(urls_expire_after={"huggingface.co": timedelta(hours=1), "*": requests_cache.DO_NOT_CACHE})
def fail_at_version(target_major, target_minor): def fail_at_version(target_major, target_minor):
""" """