There was an error while loading. Please reload this page.
1 parent 6281a81 commit 98fbd60Copy full SHA for 98fbd60
1 file changed
src/basic_memory/alembic/env.py
@@ -21,8 +21,12 @@
21
22
from basic_memory.config import ConfigManager
23
24
-# set config.env to "test" for pytest to prevent logging to file in utils.setup_logging()
25
-os.environ["BASIC_MEMORY_ENV"] = "test"
+# Trigger: only set test env when actually running under pytest
+# Why: alembic/env.py is imported during normal operations (MCP server startup, migrations)
26
+# but we only want test behavior during actual test runs
27
+# Outcome: prevents is_test_env from returning True in production, enabling watch service
28
+if os.getenv("PYTEST_CURRENT_TEST") is not None:
29
+ os.environ["BASIC_MEMORY_ENV"] = "test"
30
31
# Import after setting environment variable # noqa: E402
32
from basic_memory.models import Base # noqa: E402
0 commit comments