"""Pytest fixtures.""" import pytest from esp32_web import create_app from esp32_web.extensions import db from esp32_web.config import TestConfig @pytest.fixture def app(): """Create test application.""" app = create_app(TestConfig) with app.app_context(): db.create_all() yield app db.drop_all() @pytest.fixture def client(app): """Create test client.""" return app.test_client() @pytest.fixture def db_session(app): """Database session for tests.""" with app.app_context(): yield db.session