Commit 761d8589 by PLN (Algolia)

fix(tests): one absent sister repo and the ratchet guarded nothing

tools/analyze_samples.py is a COMMITTED symlink into ../tidal-ears, which is
not cloned on the XPS24. rglob could see the path and read_text could not open
it, and _offenders() caught only SyntaxError — so a FileNotFoundError escaped
at import time and the whole module failed COLLECTION.

That is the exact failure this file exists to prevent, turned on itself: the
guard reported nothing rather than reporting a gap, and a guard that cannot run
guards nothing. Skip unreadable paths explicitly.

Verified standalone on the rig interpreter: 3 tests pass, 256 files scanned.
parent 829e37f9
...@@ -122,6 +122,14 @@ def _offenders(): ...@@ -122,6 +122,14 @@ def _offenders():
tree = ast.parse(src) tree = ast.parse(src)
except SyntaxError: except SyntaxError:
continue continue
except OSError:
# A path rglob can SEE but not READ: this repo commits symlinks to
# its sister projects (tools/analyze_samples.py -> ../tidal-ears/),
# and a box that has not cloned the sibling has a dangling one. That
# made the whole scan uncollectable — one absent sister repo and the
# ratchet guarded NOTHING, silently, which is the failure mode this
# file exists to prevent in the first place.
continue
lines = src.splitlines() lines = src.splitlines()
for lineno, value in _string_constants(tree): for lineno, value in _string_constants(tree):
if not _looks_like_tidal_regex(value): if not _looks_like_tidal_regex(value):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment