mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
fix(api): stop serve cleanly with jobs, streams and remote sessions open
This commit is contained in:
@@ -88,10 +88,14 @@ def wait_for_health(url: str, secret_key: str, timeout: float = 60.0) -> bool:
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def isolated_job_history(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Redirect job history writes to tmp_path so tests don't append to the server's api_history.jsonl."""
|
||||
"""Redirect job history writes to tmp_path and give each test its own download manager.
|
||||
|
||||
An app teardown shuts the global manager down, and a shut-down manager refuses new jobs.
|
||||
"""
|
||||
from unshackle.core.api import download_manager
|
||||
|
||||
monkeypatch.setattr(download_manager, "history_path", lambda: tmp_path / "api_history.jsonl")
|
||||
monkeypatch.setattr(download_manager, "download_manager", None)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
||||
Reference in New Issue
Block a user