Skip to content

Commit

Permalink
test: update tests after pytest-asyncio update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreemurro committed Jul 1, 2024
1 parent 511f468 commit 135d04c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import asyncio

import pytest
import pytest_asyncio
from blacksheep.testing import TestClient

from esoraider_server.app import app as app_server


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


@pytest_asyncio.fixture(scope='session')
async def api():
await app_server.start()
Expand Down
10 changes: 5 additions & 5 deletions tests/test_server_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,39 +126,39 @@ def id_of_test(log: TestLog) -> str:
return log.desc


@pytest.mark.asyncio
@pytest.mark.asyncio(scope='session')
@pytest.mark.parametrize('log', LOGS, ids=id_of_test)
async def test_get_log(test_client: TestClient, log: TestLog):
response = await test_client.get(log.link)

assert response.status == log.expected


@pytest.mark.asyncio
@pytest.mark.asyncio(scope='session')
@pytest.mark.parametrize('fight', FIGHTS, ids=id_of_test)
async def test_get_fight(test_client: TestClient, fight: TestLog):
response = await test_client.get(fight.link)

assert response.status == fight.expected


@pytest.mark.asyncio
@pytest.mark.asyncio(scope='session')
@pytest.mark.parametrize('char', CHARS, ids=id_of_test)
async def test_get_char(test_client: TestClient, char: TestLog):
response = await test_client.get(char.link, query=char.query)

assert response.status == char.expected


@pytest.mark.asyncio
@pytest.mark.asyncio(scope='session')
@pytest.mark.parametrize('fight', FIGHT_EFFECTS, ids=id_of_test)
async def test_get_fight_effects(test_client: TestClient, fight: TestLog):
response = await test_client.get('/fight' + fight.link)

assert response.status == fight.expected


@pytest.mark.asyncio
@pytest.mark.asyncio(scope='session')
@pytest.mark.parametrize('encounter', ENCOUNTERS)
async def test_get_encounter_info(test_client: TestClient, encounter: int):
response = await test_client.get('/encounter/{0}'.format(encounter))
Expand Down

0 comments on commit 135d04c

Please sign in to comment.