Repository navigation
Share capture-mode setup in tree snapshot tests and drop unreachable open-failure branches - #176
Merged
Merged
Conversation
Seven tests and the _capture helper spelled out the descriptor-capture skip, the portable-capture patch or the listdir guard inline. Three helpers now hold them; the guard's two assertion messages become one.
open_directory handles ENOENT and ENOTDIR as retryable before it calls _open_failure, so the FileNotFoundError and NotADirectoryError cases could not run.
#181 added _require_descriptor_capture and _use_portable_capture to tests/test_lean_sources.py with the same bodies as the copies here. Import them instead, as tests/test_contract.py imports helpers from tests/test_impact.py.
Contributor
Author
Review at 50161a2Verdict: merge-ready (the PR is still a draft). The two
The test refactor keeps every skip guard and patch. The imported helpers have exactly the bodies they replace, and only the Landing
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #95. +27/-82 against main.
tests/test_tree_snapshot_limits.py). Seven tests and the_capturehelper spelled out the descriptor-capture skip, the portable-capture patch or theos.listdirguard inline. They now call_require_descriptor_capture,_use_portable_captureand_forbid_unbounded_listdir. The first two are imported fromtests/test_lean_sources.py, where Share checkpoint, bind-count, and fixture helpers in the Lean source tests #181 added them with the same bodies, astests/test_contract.pyimports helpers fromtests/test_impact.py. The guard's two assertion messages become one, "unexpected unbounded os.listdir call"; they appear only in a failure report, since the tests match theTreeSnapshotErrortext._open_failure(autoform_cli/_directory_binding.py).open_directoryhandles ENOENT and ENOTDIR as retryable before it calls_open_failure, so theFileNotFoundErrorandNotADirectoryErrorbranches could not run. They are removed; no test reached them.The branch merges current main (with #178 and #181). No other open PR edits these files, and it merges cleanly with all 18 of them.
Validation at exact head
50161a2c:ruff check autoform_cli servers testsis clean.tests/test_tree_snapshot_limits.pypasses (37), andtests/test_lean_sources.pygives 140 passed, 3 skipped and 1 expected failure.