-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Datagram servers: Removed task locks because it is useless (#336)
- Loading branch information
1 parent
c319364
commit 94f5e72
Showing
5 changed files
with
51 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
tests/functional_test/test_communication/test_async/conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
import asyncio | ||
import sys | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(params=[True, False] if sys.version_info >= (3, 12) else [False], ids=lambda p: f"enable_eager_tasks=={p}") | ||
@pytest.fixture(params=[True, False], ids=lambda p: f"enable_eager_tasks=={p}") | ||
def enable_eager_tasks(request: pytest.FixtureRequest, event_loop: asyncio.AbstractEventLoop) -> bool: | ||
enable_eager_tasks = bool(request.param) | ||
if enable_eager_tasks: | ||
event_loop.set_task_factory(getattr(asyncio, "eager_task_factory")) | ||
try: | ||
eager_task_factory = getattr(asyncio, "eager_task_factory") | ||
except AttributeError: | ||
pytest.skip("asyncio.eager_task_factory not implemented") | ||
else: | ||
event_loop.set_task_factory(eager_task_factory) | ||
return enable_eager_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters