chore: update to latest pytest (#2800)

This commit is contained in:
dni ⚡ 2024-12-11 10:39:28 +01:00 committed by GitHub
parent 8ff4962e86
commit 291c69e470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 303 additions and 310 deletions

View file

@ -1,10 +1,9 @@
import pytest
import pytest_asyncio
from tests.helpers import DbTestModel
@pytest_asyncio.fixture(scope="session")
@pytest.fixture(scope="session")
async def fetch_page(db):
await db.execute("DROP TABLE IF EXISTS test_db_fetch_page")
await db.execute(
@ -30,7 +29,7 @@ async def fetch_page(db):
await db.execute("DROP TABLE test_db_fetch_page")
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_db_fetch_page_simple(fetch_page, db):
row = await db.fetch_page(
query="select * from test_db_fetch_page",
@ -42,7 +41,7 @@ async def test_db_fetch_page_simple(fetch_page, db):
assert len(row.data) == 5
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_db_fetch_page_group_by(fetch_page, db):
row = await db.fetch_page(
query="select max(id) as id, name from test_db_fetch_page",
@ -53,7 +52,7 @@ async def test_db_fetch_page_group_by(fetch_page, db):
assert row.total == 4
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_db_fetch_page_group_by_multiple(fetch_page, db):
row = await db.fetch_page(
query="select max(id) as id, name, value from test_db_fetch_page",
@ -64,7 +63,7 @@ async def test_db_fetch_page_group_by_multiple(fetch_page, db):
assert row.total == 5
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_db_fetch_page_group_by_evil(fetch_page, db):
with pytest.raises(ValueError, match="Value for GROUP BY is invalid"):
await db.fetch_page(