From 8ba0715141cb6edba9fa1b65d48d5dcf90e11909 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 22 Aug 2025 17:52:48 -0700 Subject: [PATCH] event_loop --- tests/image_gen_tests/conftest.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/image_gen_tests/conftest.py diff --git a/tests/image_gen_tests/conftest.py b/tests/image_gen_tests/conftest.py new file mode 100644 index 00000000000..fe04da2c66e --- /dev/null +++ b/tests/image_gen_tests/conftest.py @@ -0,0 +1,22 @@ + +import importlib +import os +import sys +import asyncio +import pytest + +sys.path.insert( + 0, os.path.abspath("../..") +) # Adds the parent directory to the system path +import litellm + +import asyncio + +@pytest.fixture(scope="session") +def event_loop(): + try: + loop = asyncio.get_running_loop() + except RuntimeError: + loop = asyncio.new_event_loop() + yield loop + loop.close() \ No newline at end of file