implement 'is_in_tests' in lib

This commit is contained in:
Jakub Trllo 2024-02-13 11:45:02 +01:00
parent 6aa2b73bbb
commit 9ce795dced
2 changed files with 12 additions and 0 deletions

View file

@ -158,6 +158,7 @@ from .ayon_info import (
is_running_from_build,
is_staging_enabled,
is_dev_mode_enabled,
is_in_tests,
)
@ -278,6 +279,7 @@ __all__ = [
"is_running_from_build",
"is_staging_enabled",
"is_dev_mode_enabled",
"is_in_tests",
"requests_get",
"requests_post"

View file

@ -38,6 +38,16 @@ def is_staging_enabled():
return os.getenv("AYON_USE_STAGING") == "1"
def is_in_tests():
"""Process is running in automatic tests mode.
Returns:
bool: True if running in tests.
"""
return os.environ.get("AYON_IN_TESTS") == "1"
def is_dev_mode_enabled():
"""Dev mode is enabled in AYON.