mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-06 08:52:50 +02:00
0ac5ba567c
- Update .flake8 and pre-commit config to properly use flake8 config - Add B008 to ignored errors (FastAPI Depends pattern) - Add E402 to ignored errors (intentional module-level imports) - Remove unused imports from test files and source files - Fix f-strings without placeholders - Add type annotations to inner async functions - Fix SQLAlchemy execute() to use text() wrapper - Add type: ignore comments for alembic.command imports - Exclude alembic/ directory from mypy in pre-commit - Update mypy overrides for test files to not require type annotations - Fix type annotations for params dicts in web routes - Fix generator return type in test fixtures
23 lines
507 B
Python
23 lines
507 B
Python
"""Fixtures for collector component tests."""
|
|
|
|
import pytest
|
|
|
|
from meshcore_hub.common.database import DatabaseManager
|
|
|
|
|
|
@pytest.fixture
|
|
def db_manager():
|
|
"""Create an in-memory database manager for testing."""
|
|
manager = DatabaseManager("sqlite:///:memory:")
|
|
manager.create_tables()
|
|
yield manager
|
|
manager.dispose()
|
|
|
|
|
|
@pytest.fixture
|
|
def db_session(db_manager):
|
|
"""Create a database session for testing."""
|
|
session = db_manager.get_session()
|
|
yield session
|
|
session.close()
|