Skip to content

Commit

Permalink
Fix pytest_asyncio warning about replacing the event_loop fixture i…
Browse files Browse the repository at this point in the history
…n test_rpkgs

See lilydjwg/nvchecker@4ca61ba
  • Loading branch information
pekkarr committed Feb 4, 2024
1 parent 1774b72 commit 6e1f281
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/test_rpkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
import pytest_asyncio

pytestmark = pytest.mark.asyncio
pytestmark = pytest.mark.asyncio(scope='session')

from nvchecker import core, __main__ as main
from nvchecker.util import Entries, VersData, RawResult
Expand All @@ -27,7 +27,7 @@ async def run(entries: Entries) -> VersData:
vers, _has_failures = await main.run(result_coro, runner_coro)
return vers

@pytest_asyncio.fixture(scope='module')
@pytest_asyncio.fixture(scope='session')
async def get_version():
async def __call__(name, config):
entries = {name: config}
Expand All @@ -36,12 +36,6 @@ async def __call__(name, config):

return __call__

loop = asyncio.new_event_loop()
@pytest.fixture(scope='module')
def event_loop(request):
yield loop
loop.close()


async def test_cran(get_version):
assert await get_version('xml2', {
Expand Down

0 comments on commit 6e1f281

Please sign in to comment.