mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 20:18:09 +00:00
helpers.strings imported helpers.files at module level while helpers.files imports sanitize_string back from helpers.strings mid-file, so any module importing helpers.strings before helpers.files failed with a partially initialized module error; the strings module now imports files inside replace_file_includes, its only consumer, keeping module-level strings imports safe codebase-wide. Validation: pytest tests/test_import_cycles.py tests/test_tool_action_contracts.py
17 lines
393 B
Python
17 lines
393 B
Python
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def test_strings_module_imports_before_files():
|
|
repo_root = Path(__file__).resolve().parents[1]
|
|
|
|
result = subprocess.run(
|
|
[sys.executable, "-c", "import helpers.strings; import helpers.files"],
|
|
cwd=repo_root,
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
|
|
assert result.returncode == 0, result.stderr
|