Skip to content

Commit

Permalink
fix default loop scope
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Nov 18, 2024
1 parent d83299d commit 1c3f66c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ markers = [
"manual: marks tests to be run only when manually directed to by the developer",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope="function"
asyncio_default_fixture_loop_scope = "session"
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import copy
import logging.config
import shutil
Expand All @@ -23,6 +24,16 @@
from tests.utils import idfn, path_resources


@pytest.fixture(scope="session")
def event_loop():
try:
loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
yield loop
loop.close()


# noinspection PyUnusedLocal
@pytest.hookimpl
def pytest_configure(config: pytest.Config):
Expand Down

0 comments on commit 1c3f66c

Please sign in to comment.