Keep integration imports lightweight
All checks were successful
Container Image / build-and-push (push) Successful in 22s

This commit is contained in:
2026-07-08 12:59:26 +02:00
parent 1bacc889ad
commit b67f208cc0
3 changed files with 58 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
import json
import os
import subprocess
import sys
def test_integrations_import_does_not_initialize_core_package():
env = dict(os.environ)
env["PYTHONPATH"] = os.getcwd()
code = (
"import json, sys; "
"import src.integrations; "
"import src.secret_storage; "
"print(json.dumps({'core_loaded': 'core' in sys.modules}))"
)
result = subprocess.run(
[sys.executable, "-c", code],
cwd=os.getcwd(),
env=env,
text=True,
capture_output=True,
timeout=10,
check=True,
)
assert json.loads(result.stdout) == {"core_loaded": False}