Commit 3a82ecd
committed
Fix compute_relative_path coverage gap and note observer.py recursion bugs
The previous compute_relative_path test passed None for ``path`` but
posixpath.relpath silently substitutes ``os.curdir`` for a None start,
so the success branch ran and lines 149-150 (the except + fallback)
stayed uncovered. Switching to a non-path-like ``file`` argument forces
os.fspath to raise TypeError inside os.path.relpath, which is what the
except clause was written to handle.
Adds a comment at the top of observer_pyt.py explaining why the
self-recursive method bodies in observer.py are deliberately not
covered -- they would recurse until the stack overflows. The recursion
appears to be a production-code bug; a follow-up commit (outside this
test-only branch) should replace ``self.X(...)`` with ``super().X(...)``
or remove the bodies entirely.1 parent 057d912 commit 3a82ecd
2 files changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
0 commit comments