ci(conftest.py): reset conftest.py for local_testing/ (#6657)

* ci(conftest.py): reset conftest.py for local_testing/

check if that speeds up testing

* fix: fix import

* fix(conftest.py): fix import to check if hasattr

* fix(conftest.py): ignore proxy reload if doesn't exist
This commit is contained in:
Krish Dholakia 2024-11-08 19:14:16 +05:30 committed by GitHub
parent 896e2c2d59
commit 9f2053e4af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,8 +26,11 @@ def setup_and_teardown():
from litellm import Router from litellm import Router
importlib.reload(litellm) importlib.reload(litellm)
try: try:
if hasattr(litellm, "proxy") and hasattr(litellm.proxy, "proxy_server"): if hasattr(litellm, "proxy") and hasattr(litellm.proxy, "proxy_server"):
import litellm.proxy.proxy_server
importlib.reload(litellm.proxy.proxy_server) importlib.reload(litellm.proxy.proxy_server)
except Exception as e: except Exception as e:
print(f"Error reloading litellm.proxy.proxy_server: {e}") print(f"Error reloading litellm.proxy.proxy_server: {e}")