migrate SCREENSHOT_DIR to new env var system

This commit is contained in:
Benedikt Bartscher 2024-10-28 23:00:48 +01:00
parent e1ec51a589
commit 93a570b5e3
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View File

@ -500,6 +500,9 @@ class EnvironmentVariables:
# Arguments to pass to the app harness driver.
APP_HARNESS_DRIVER_ARGS: EnvVar[str] = env_var("")
# Where to save screenshots when tests fail.
SCREENSHOT_DIR: EnvVar[Optional[Path]] = env_var(None)
environment = EnvironmentVariables()

View File

@ -43,7 +43,7 @@ def pytest_exception_interact(node, call, report):
call: The pytest call describing when/where the test was invoked.
report: The pytest log report object.
"""
screenshot_dir = os.environ.get("SCREENSHOT_DIR")
screenshot_dir = environment.SCREENSHOT_DIR.get
if DISPLAY is None or screenshot_dir is None:
return