mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-06 01:48:25 -04:00
26 lines
618 B
Python
26 lines
618 B
Python
"""Test configuration and fixtures for the backend tests."""
|
|
|
|
from unittest.mock import AsyncMock
|
|
from unittest.mock import MagicMock
|
|
|
|
import pytest
|
|
from fastapi.testclient import TestClient
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from backend.main import app
|
|
|
|
|
|
type MockLogger = MagicMock
|
|
|
|
|
|
@pytest.fixture
|
|
def async_session() -> AsyncSession:
|
|
"""Fixture to provide a mocked AsyncSession for database interactions."""
|
|
return AsyncMock(spec=AsyncSession)
|
|
|
|
|
|
@pytest.fixture
|
|
def client() -> TestClient:
|
|
"""Fixture to provide a FastAPI TestClient for testing endpoints."""
|
|
return TestClient(app)
|