Skip to content

The agent that grows with you

test(compat): preserve nested first-party directories

fangliquan9e2962e0d1ce
diff --git a/tests/scripts/test_check_compat_pointers.py b/tests/scripts/test_check_compat_pointers.py
index 4e7f20c55c8..d06ab317233 100644
--- a/tests/scripts/test_check_compat_pointers.py
+++ b/tests/scripts/test_check_compat_pointers.py
@@ -19,6 +19,8 @@ def test_py_files_prunes_dependency_trees_before_descent(tmp_path, monkeypatch):
mod = _load()
(tmp_path / "package").mkdir()
(tmp_path / "package" / "source.py").write_text("VALUE = 1\n", encoding="utf-8")
+ (tmp_path / "package" / "apps").mkdir()
+ (tmp_path / "package" / "apps" / "nested.py").write_text("VALUE = 3\n", encoding="utf-8")
excluded = [
tmp_path / ".venv",
tmp_path / "venv",
@@ -41,6 +43,9 @@ def test_py_files_prunes_dependency_trees_before_descent(tmp_path, monkeypatch):
monkeypatch.setattr(mod, "ROOT", tmp_path)
monkeypatch.setattr(mod.os, "walk", tracking_walk)
- assert list(mod._py_files()) == [tmp_path / "package" / "source.py"]
+ assert set(mod._py_files()) == {
+ tmp_path / "package" / "source.py",
+ tmp_path / "package" / "apps" / "nested.py",
+ }
assert tmp_path in visited
assert not set(excluded) & set(visited)
\ No newline at end of file