test(conftest): reset the decrypt hook and the licence-only flag that a dl run leaves set

This commit is contained in:
imSp4rky
2026-12-02 17:12:41 -07:00
parent 9622ebfdae
commit 95d36378f4
3 changed files with 13 additions and 12 deletions
+9 -1
View File
@@ -14,7 +14,8 @@ import pytest
from unshackle.core import binaries, console, process_exit
from unshackle.core import session as http_session
from unshackle.core.config import config
from unshackle.core.constants import RunCancel
from unshackle.core.constants import DOWNLOAD_LICENCE_ONLY, RunCancel
from unshackle.core.drm import verify
from unshackle.core.providers import anilist
from unshackle.core.proxies.proxy import CATALOGUES
from unshackle.core.update_checker import UpdateChecker
@@ -100,6 +101,13 @@ def no_filename_replacements(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(config, "filename_replacements", {})
@pytest.fixture(autouse=True)
def no_dl_run_state(monkeypatch: pytest.MonkeyPatch) -> None:
"""Start without the decrypt hook and the licence-only flag that a dl run of an earlier test leaves set."""
monkeypatch.setattr(verify, "DECRYPT_HOOK", None)
DOWNLOAD_LICENCE_ONLY.clear()
@pytest.fixture(autouse=True)
def no_speed_limit(monkeypatch: pytest.MonkeyPatch) -> None:
"""Start with no speed limit, so a limit that an earlier test locked cannot block a later one."""