fix: use @pytest_asyncio.fixture for async fixtures in test_engine.py
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user