From 93a570b5e3aea71eb5e2a10ccd26b8c5ec9c3859 Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Mon, 28 Oct 2024 23:00:48 +0100 Subject: [PATCH] migrate SCREENSHOT_DIR to new env var system --- reflex/config.py | 3 +++ tests/integration/conftest.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/config.py b/reflex/config.py index bff7bca1b..7b910e3e1 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -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() diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 98c5fda39..2d0febe00 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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