Files
odysseus/tests/test_integrations_import_lightweight.py
MrSphay b67f208cc0
All checks were successful
Container Image / build-and-push (push) Successful in 22s
Keep integration imports lightweight
2026-07-08 12:59:26 +02:00

26 lines
637 B
Python

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}