Skip to content

Commit

Permalink
Context without event_loop (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalev authored Dec 26, 2024
1 parent 34b4c4c commit 74749e0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pytest_aioworkers/plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from unittest import mock

import pytest
Expand Down Expand Up @@ -36,14 +37,18 @@ def config(aioworkers, config_yaml):


@pytest.fixture
def context(event_loop, groups, config):
async def context(aioworkers, config):
from aioworkers.core.context import Context, GroupResolver

gr = GroupResolver(
include=groups.include,
exclude=groups.exclude,
include=aioworkers.groups.include,
exclude=aioworkers.groups.exclude,
)
with Context(config, group_resolver=gr, loop=event_loop) as ctx:
async with Context(
config,
group_resolver=gr,
loop=asyncio.get_running_loop(),
) as ctx:
yield ctx


Expand Down

0 comments on commit 74749e0

Please sign in to comment.