(ci/cd) fix event loop bug proxy_test

This commit is contained in:
ishaan-jaff 2024-01-06 12:30:43 +05:30
parent 250672eddc
commit 3bb49447bc

View file

@ -58,18 +58,18 @@ save_worker_config(
import asyncio import asyncio
@pytest.fixture # @pytest.fixture
def event_loop(): # def event_loop():
"""Create an instance of the default event loop for each test case.""" # """Create an instance of the default event loop for each test case."""
policy = asyncio.WindowsSelectorEventLoopPolicy() # policy = asyncio.WindowsSelectorEventLoopPolicy()
res = policy.new_event_loop() # res = policy.new_event_loop()
asyncio.set_event_loop(res) # asyncio.set_event_loop(res)
res._close = res.close # res._close = res.close
res.close = lambda: None # res.close = lambda: None
yield res # yield res
res._close() # res._close()
# Here you create a fixture that will be used by your tests # Here you create a fixture that will be used by your tests