from __future__ import annotations import os from typing import Iterator import pytest from fastapi.testclient import TestClient # Use MySQL test database from environment or default os.environ.setdefault( "DATABASE_URL", "mysql+asyncmy://root:hn02le.34lkdLKD@121.43.228.102:3306/dibang-test?charset=utf8mb4" ) os.environ.setdefault("ENV", "test") from app.main import app # noqa: E402 @pytest.fixture(scope="module") def client() -> Iterator[TestClient]: with TestClient(app) as test_client: yield test_client