Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

chore(tests): strip credential-shaped env vars so the suite is hermetic (#1128)

dzivkoviee1080cce34d
diff --git a/tests/conftest.py b/tests/conftest.py
index e94ab54a..b9bfba11 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,3 +1,4 @@
+import os
import sys
from pathlib import Path
from unittest import mock
@@ -55,3 +56,20 @@ def _reset_reddit_keyless_memo():
_http.reset_reddit_keyless_memo()
yield
_http.reset_reddit_keyless_memo()
+
+
[email protected](autouse=True)
+def _no_ambient_credentials(monkeypatch):
+ """Strip credential-shaped variables from the process environment.
+
+ ``env.get_config()`` reads API keys and cookies straight from os.environ, so
+ a developer machine with real credentials exported resolves config the CI
+ box never would (upstream CI is a clean Linux runner). Tests that need a
+ credential set it themselves; nothing should depend on the ambient one.
+ """
+ suffixes = ("_API_KEY", "_TOKEN", "_KEY", "_SECRET", "_PASSWORD", "_COOKIE")
+ exact = {"AUTH_TOKEN", "CT0", "SESSION_ID"}
+ for name in list(os.environ):
+ if name in exact or name.endswith(suffixes):
+ monkeypatch.delenv(name, raising=False)
+ yield