Skip to content

Commit

Permalink
Merge pull request #207 from pekkarr/fix-rpkgs-tests
Browse files Browse the repository at this point in the history
Fix test_rpkgs
  • Loading branch information
lilydjwg authored Feb 4, 2024
2 parents a08cfe3 + 6e1f281 commit 9fddbad
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 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,27 +36,21 @@ 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', {
'source': 'rpkgs',
'pkgname': 'xml2',
'repo': 'cran',
'md5': True,
}) == '1.3.5#20780f576451bb22e74ba6bb3aa09435'
}) == '1.3.6#fc6679028dca1f3047c8c745fb724524'

async def test_bioc(get_version):
assert await get_version('BiocVersion', {
'source': 'rpkgs',
'pkgname': 'BiocVersion',
'repo': 'bioc',
}) == '3.18.0'
}) == '3.18.1'

async def test_bioc_data_annotation(get_version):
assert await get_version('GO.db', {
Expand Down

0 comments on commit 9fddbad

Please sign in to comment.