fix: use @pytest_asyncio.fixture for async fixtures in test_engine.py

This commit is contained in:
2026-05-11 21:39:12 +02:00
parent 19987d68a0
commit ed64b5ff62
+3 -2
View File
@@ -1,4 +1,5 @@
import pytest
import pytest_asyncio
import tempfile
import os
from pathlib import Path
@@ -6,7 +7,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.models import Source, Job, JobExecution
from backup.engine import BackupEngine
@pytest.fixture
@pytest_asyncio.fixture
async def test_source(db: AsyncSession):
with tempfile.TemporaryDirectory() as tmpdir:
# Create test files
@@ -24,7 +25,7 @@ async def test_source(db: AsyncSession):
await db.refresh(source)
yield source
@pytest.fixture
@pytest_asyncio.fixture
async def test_job(db: AsyncSession, test_source):
with tempfile.TemporaryDirectory() as tmpdir:
job = Job(