mirror of
https://github.com/exo-explore/exo.git
synced 2025-12-23 22:27:50 -05:00
22 lines
575 B
Python
22 lines
575 B
Python
"""Pytest configuration and shared fixtures for shared package tests."""
|
|
|
|
import asyncio
|
|
from typing import Generator
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def event_loop() -> Generator[asyncio.AbstractEventLoop, None, None]:
|
|
"""Create an event loop for the test session."""
|
|
loop = asyncio.new_event_loop()
|
|
asyncio.set_event_loop(loop)
|
|
yield loop
|
|
loop.close()
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def reset_event_loop():
|
|
"""Reset the event loop for each test to ensure clean state."""
|
|
# This ensures each test gets a fresh event loop state
|