Pin Applio 3.6.5 and verified basis assets, migrate private voice provenance, and coordinate conversion/live/training with Deck GPU leases. Prepare an inactive voice profile and a restricted studio container. Move CUDA and Torch caches out of the small temporary filesystem to prevent OmniVoice reference failures. Package app updates from the explicit allowlist in one Docker layer.
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
"""Test configuration."""
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def tmp_dirs(tmp_path):
|
|
"""Create temporary directories for testing."""
|
|
dirs = {
|
|
"models": tmp_path / "models",
|
|
"datasets": tmp_path / "datasets",
|
|
"jobs": tmp_path / "jobs",
|
|
"results": tmp_path / "results",
|
|
"uploads": tmp_path / "uploads",
|
|
}
|
|
for d in dirs.values():
|
|
d.mkdir(parents=True, exist_ok=True)
|
|
return dirs
|
|
|
|
|
|
@pytest.fixture
|
|
def client(tmp_dirs):
|
|
"""Create a test client with isolated directories."""
|
|
import os
|
|
os.environ["MODELS_DIR"] = str(tmp_dirs["models"])
|
|
os.environ["DATASETS_DIR"] = str(tmp_dirs["datasets"])
|
|
os.environ["JOBS_DIR"] = str(tmp_dirs["jobs"])
|
|
os.environ["RESULTS_DIR"] = str(tmp_dirs["results"])
|
|
os.environ["UPLOADS_DIR"] = str(tmp_dirs["uploads"])
|
|
|
|
# Reset settings singleton
|
|
from app import config
|
|
from app.jobs import store
|
|
|
|
config._settings = None
|
|
store._store = None
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
from app.main import create_app
|
|
|
|
app = create_app()
|
|
with TestClient(app) as c:
|
|
yield c
|
|
|
|
config._settings = None
|
|
store._store = None
|