From 23fc6c70614137106d43332c9f62dd8017caa541 Mon Sep 17 00:00:00 2001 From: hnshah Date: Tue, 14 Apr 2026 04:48:53 -0700 Subject: [PATCH] fix(env): default INCLUDE_SOURCES to empty string (#223) * fix(env): default INCLUDE_SOURCES to empty string * test(env): patch resolved config path in include sources test --- scripts/lib/env.py | 2 +- tests/test_env_include_sources_default.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/test_env_include_sources_default.py diff --git a/scripts/lib/env.py b/scripts/lib/env.py index 58042e5..f5b61d7 100644 --- a/scripts/lib/env.py +++ b/scripts/lib/env.py @@ -264,7 +264,7 @@ def get_config() -> dict[str, Any]: ('XQUIK_API_KEY', None), ('FROM_BROWSER', None), ('SETUP_COMPLETE', None), - ('INCLUDE_SOURCES', None), + ('INCLUDE_SOURCES', ''), ] for key, default in keys: diff --git a/tests/test_env_include_sources_default.py b/tests/test_env_include_sources_default.py new file mode 100644 index 0000000..a6e2bfd --- /dev/null +++ b/tests/test_env_include_sources_default.py @@ -0,0 +1,14 @@ +from scripts.lib import env + + +def test_include_sources_defaults_to_empty_string(monkeypatch, tmp_path): + # Ensure the env var is not set + monkeypatch.delenv("INCLUDE_SOURCES", raising=False) + + # Avoid reading any real user config file by patching the resolved module path directly + monkeypatch.setattr(env, "CONFIG_FILE", tmp_path / "does-not-exist.env") + + cfg = env.get_config() + + assert "INCLUDE_SOURCES" in cfg + assert cfg["INCLUDE_SOURCES"] == ""