mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
fix(remote): end the remote session when a signal or a closed console stops the client
This commit is contained in:
+9
-1
@@ -11,7 +11,7 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.core import binaries
|
||||
from unshackle.core import binaries, process_exit
|
||||
from unshackle.core import session as http_session
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.providers import anilist
|
||||
@@ -59,6 +59,14 @@ def client_process(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(http_session, "record_bodies", True)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def keep_signal_handlers(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Keep the signal handlers of a command or a job worker out of the pytest process."""
|
||||
monkeypatch.setattr(process_exit, "listen", lambda *args: None)
|
||||
monkeypatch.setattr(process_exit.Stop, "raised", False)
|
||||
monkeypatch.setattr(process_exit, "ends", set())
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def fresh_proxy_catalogues() -> None:
|
||||
"""Fetch each proxy provider catalogue again, so one test's stub never answers another test."""
|
||||
|
||||
Reference in New Issue
Block a user