File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,3 +36,21 @@ def test_ast_guard_modules_reuse_shared_collect_function_sources_helper():
3636 violating_modules .append (module_path )
3737
3838 assert violating_modules == []
39+
40+
41+ def test_ast_guard_inventory_stays_in_sync_with_helper_imports ():
42+ excluded_modules = {
43+ "tests/test_ast_function_source_helper_usage.py" ,
44+ "tests/test_ast_function_source_utils.py" ,
45+ }
46+ discovered_modules : list [str ] = []
47+ for module_path in sorted (Path ("tests" ).glob ("test_*.py" )):
48+ normalized_path = module_path .as_posix ()
49+ if normalized_path in excluded_modules :
50+ continue
51+ module_text = module_path .read_text (encoding = "utf-8" )
52+ if "ast_function_source_utils import collect_function_sources" not in module_text :
53+ continue
54+ discovered_modules .append (normalized_path )
55+
56+ assert sorted (AST_FUNCTION_SOURCE_GUARD_MODULES ) == discovered_modules
You can’t perform that action at this time.
0 commit comments