This commit is contained in:
2025-10-22 17:39:28 +02:00
parent 6db850c2ad
commit 5c2691b070
7 changed files with 198 additions and 181 deletions

View File

@@ -312,10 +312,15 @@ def get_anime_service() -> "AnimeService":
import sys
import tempfile
running_tests = (
"PYTEST_CURRENT_TEST" in os.environ
or "pytest" in sys.modules
)
# Prefer explicit test mode opt-in via ANIWORLD_TESTING=1; fall back
# to legacy heuristics for backwards compatibility with CI.
running_tests = os.getenv("ANIWORLD_TESTING") == "1"
if not running_tests:
running_tests = (
"PYTEST_CURRENT_TEST" in os.environ
or "pytest" in sys.modules
)
if running_tests:
settings.anime_directory = tempfile.gettempdir()
else: