Spaces:
Sleeping
Sleeping
Download tests/conftest.py from EAT-Prototypes/jellyscope: direct link, hf CLI and curl.
- Browser
- Download file 784 Bytes
-
https://huggingface.co/spaces/EAT-Prototypes/jellyscope/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/EAT-Prototypes/jellyscope/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/EAT-Prototypes/jellyscope/resolve/main/tests/conftest.py
784 Bytes
| """Shared test fixtures.""" | |
| from pathlib import Path | |
| import pytest | |
| from fastapi import FastAPI | |
| from starlette.testclient import TestClient | |
| from jellyscope.config import JellyscopeConfig | |
| from jellyscope.data.data_store import DataStore | |
| SESSION_SCOPE: str = "session" | |
| def config() -> JellyscopeConfig: | |
| return JellyscopeConfig(data_dir=Path("data")) | |
| def store(config: JellyscopeConfig) -> "DataStore": | |
| DataStore.reset() | |
| return DataStore.get(config) | |
| def app(config: JellyscopeConfig) -> FastAPI: | |
| from jellyscope.web import create_app | |
| DataStore.reset() | |
| return create_app(config) | |
| def client(app: FastAPI) -> TestClient: | |
| return TestClient(app) | |