diff --git a/tests/local_testing/conftest.py b/tests/local_testing/conftest.py index 5535a62bb81..dce367aa915 100644 --- a/tests/local_testing/conftest.py +++ b/tests/local_testing/conftest.py @@ -259,6 +259,11 @@ def setup_and_teardown(): yield +@pytest.fixture +def unroutable_api_base(): + return "http://192.0.2.1" + + def pytest_collection_modifyitems(config, items): apply_vcr_auto_marker_to_items( items, diff --git a/tests/local_testing/test_embedding.py b/tests/local_testing/test_embedding.py index ee2ac14f498..6e09e46d6f9 100644 --- a/tests/local_testing/test_embedding.py +++ b/tests/local_testing/test_embedding.py @@ -266,11 +266,12 @@ def test_openai_azure_embedding_timeouts(): # test_openai_azure_embedding_timeouts() -def test_openai_embedding_timeouts(): +def test_openai_embedding_timeouts(unroutable_api_base): try: response = embedding( model="text-embedding-ada-002", input=["good morning from litellm"], + api_base=unroutable_api_base, timeout=0.00001, ) print(response) diff --git a/tests/local_testing/test_timeout.py b/tests/local_testing/test_timeout.py index 66054a0930a..217a71dec16 100644 --- a/tests/local_testing/test_timeout.py +++ b/tests/local_testing/test_timeout.py @@ -211,13 +211,14 @@ def test_hanging_request_openai(): # test_timeout() -def test_timeout_streaming(): +def test_timeout_streaming(unroutable_api_base): # this Will Raise a timeout litellm.set_verbose = False try: response = litellm.completion( model="gpt-3.5-turbo", messages=[{"role": "user", "content": "hello, write a 20 pg essay"}], + api_base=unroutable_api_base, timeout=0.0001, stream=True, )