From ebf1bc842c418dfe94d92aa1f6ccc18a7abc4952 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 13 Jan 2024 14:23:04 +0530 Subject: [PATCH] fix(conftest.py): create an event loop if one isn't made --- litellm/tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/tests/conftest.py b/litellm/tests/conftest.py index 0e8b656abd..4cd277b31d 100644 --- a/litellm/tests/conftest.py +++ b/litellm/tests/conftest.py @@ -29,6 +29,10 @@ def setup_and_teardown(): # from litellm import Router, completion, aembedding, acompletion, embedding yield + # Teardown code (executes after the yield point) + loop.close() # Close the loop created earlier + asyncio.set_event_loop(None) # Remove the reference to the loop + def pytest_collection_modifyitems(config, items): # Separate tests in 'test_amazing_proxy_custom_logger.py' and other tests