You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the Narrowed-Scan Diff-Floor Test Independent of the Working Directory #2830
tests/test_prose_lint.pyTestDiffScopeFloor.test_a_deliberately_narrowed_scan_is_not_told_the_narrowing_is_a_defect passes only when the test process's working directory contains an entry named catalog.
The test narrows the scan with the bare relative path catalog, and it mocks repo_root, discover, and changed_lines. It never creates catalog under its temporary root. Before the diff-floor logic runs, prose_lint.main refuses any requested path that is neither a file nor a directory relative to the working directory, and returns 2. The hub's root happens to have a tracked catalog/ directory, so a run from the root passes and a run from anywhere else fails with 0 != 2. The floor logic under test is not at fault.
Repro
From a clean develop checkout:
cd tests && python3 -m unittest test_prose_lint.TestDiffScopeFloor.test_a_deliberately_narrowed_scan_is_not_told_the_narrowing_is_a_defect fails with AssertionError: 0 != 2.
python3 -m unittest discover -s tests -p test_prose_lint.py -k narrowed, run from the root, passes.
CI and the file's own header both run from the root, so CI stays green, and the defect shows up only in a local run started elsewhere.
Proposed fix
Make the test self-contained: create self.tmp / "catalog" and pass str(self.tmp / "catalog") as the narrowing argument, so the path resolves against the mocked root rather than the working directory. Check the sibling tests that pass a relative path for the same dependence.
Activity
Make the Narrowed-Scan Diff-Floor Test Independent of the Working Dir…
Promote Five Develop Fixes for Config Comments, Lint Images, and Conc…