diff --git a/tests/test_import_hygiene.py b/tests/test_import_hygiene.py index 4129e348..43d85977 100644 --- a/tests/test_import_hygiene.py +++ b/tests/test_import_hygiene.py @@ -11,20 +11,23 @@ import subprocess import sys +import textwrap -_PROBE = """ -import sys -import aai_cli.main -heavy = {"jiwer", "rapidfuzz"} -loaded = sorted(heavy & {name.split(".")[0] for name in sys.modules}) -assert not loaded, f"CLI import eagerly loaded: {loaded}" -""" +_PROBE = textwrap.dedent( + """ + import sys + import aai_cli.main + heavy = {"jiwer", "rapidfuzz"} + loaded = sorted(heavy & {name.split(".")[0] for name in sys.modules}) + assert not loaded, f"CLI import eagerly loaded: {loaded}" + """ +).strip() def test_cli_import_does_not_load_eval_scoring_stack(): # A fresh interpreter: the suite's own process has long since imported the # scoring stack, so sys.modules can only be probed in a child. result = subprocess.run( - [sys.executable, "-c", _PROBE], capture_output=True, text=True, timeout=120, check=False + [sys.executable, "-c", _PROBE], capture_output=True, text=True, timeout=15, check=False ) assert result.returncode == 0, result.stderr