cleanup
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user