Spaces:
Sleeping
Sleeping
| """Shared fixtures for AutoApp Builder tests.""" | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| # Ensure imports resolve from the hf/ directory. | |
| HF_ROOT = Path(__file__).resolve().parent.parent | |
| if str(HF_ROOT) not in sys.path: | |
| sys.path.insert(0, str(HF_ROOT)) | |
| from app.main import app as fastapi_app | |
| def client(): | |
| """Synchronous test client for the FastAPI app using Starlette's TestClient.""" | |
| from starlette.testclient import TestClient | |
| with TestClient(fastapi_app, raise_server_exceptions=False) as c: | |
| yield c | |