personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

test: skip unparseable .py files in legacy-chat regression guard

The two regression tests walked every `*.py` under ROOT (excluding .venv
and __pycache__) and unconditionally ast.parse'd each one. A stray
untracked scratch script in the repo root (filter_vconic_activity.py,
from 2026-04-09) had a syntax error and took both tests down.

Skip files that fail to parse — they can't contain a live Python
import/name/attribute by definition, so the regression guard isn't
weakened by treating them as "not real code."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+13 -2
+13 -2
tests/test_no_legacy_chat_imports.py
··· 41 41 ] 42 42 43 43 44 + def _parse(path: Path) -> ast.Module | None: 45 + try: 46 + return ast.parse(path.read_text(encoding="utf-8"), filename=str(path)) 47 + except SyntaxError: 48 + return None 49 + 50 + 44 51 def test_no_legacy_chat_imports_or_usages(): 45 52 violations: list[str] = [] 46 53 47 54 for path in _python_files(): 48 - tree = ast.parse(path.read_text(encoding="utf-8"), filename=str(path)) 55 + tree = _parse(path) 56 + if tree is None: 57 + continue 49 58 for node in ast.walk(tree): 50 59 if isinstance(node, ast.Import): 51 60 for alias in node.names: ··· 70 79 continue 71 80 if path == Path(__file__).resolve(): 72 81 continue 73 - tree = ast.parse(path.read_text(encoding="utf-8"), filename=str(path)) 82 + tree = _parse(path) 83 + if tree is None: 84 + continue 74 85 for node in ast.walk(tree): 75 86 if isinstance(node, ast.Constant) and node.value == LEGACY_NAME: 76 87 violations.append(str(path))