Skip to content

Commit

Permalink
Remove deprecated loop fixture usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Mar 11, 2024
1 parent 8bf207f commit 2833063
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_agen_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class TestSessionScopeAsyncGenFixture:

@pytest.fixture(scope="session")
def loop(self):
def event_loop(self):
with entrypoint() as loop:
yield loop

Expand Down
8 changes: 4 additions & 4 deletions tests/test_fixture_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@


@pytest.fixture(scope="module")
def loop():
def event_loop():
with entrypoint() as loop:
asyncio.set_event_loop(loop)
yield loop


@pytest.fixture(scope="module")
async def sample_fixture(loop):
async def sample_fixture(event_loop):
yield 1


async def test_using_fixture(sample_fixture, loop):
async def test_using_fixture(sample_fixture, event_loop):
loop_id = id(asyncio.get_event_loop())
assert sample_fixture == 1
assert id(loop) == loop_id
assert id(event_loop) == loop_id
2 changes: 1 addition & 1 deletion tests/test_loop_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from aiomisc import Service
from aiomisc_pytest.pytest_plugin import PortSocket
from aiomisc_pytest import PortSocket


class _TestService(Service):
Expand Down

0 comments on commit 2833063

Please sign in to comment.