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
Hi! This PR is currently blocked because it has no required label, and the workflows are awaiting maintainer approval. I think bug would fit this change since it adds a regression test for existing zsh path completion behavior. Could someone please add the appropriate label and approve the workflows?
Why the "_files" in result.stdout assertion is the right check
For a Path argument with no autocompletion callback there are no string completions to feed back, so ZshComplete.format_completion (in typer/_completion_classes.py) returns the literal string "_files" — that's the signal that tells the zsh completion script to fall back to the shell's own file-completion. Asserting on "_files" therefore verifies the path-completion code path actually reaches the fallback, which the existing bash test (which only asserts returncode == 0) does not. Useful regression coverage.
Scope
Keeping this PR to zsh-only feels right — complete_bash, complete_fish, and complete_powershell/complete_pwsh all use different fallback mechanisms (or no fallback at all, depending on the shell), so a Path-completion test for each would warrant separate, shell-specific assertions and isn't a natural fit for this PR.
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
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.
Adds a small regression test for zsh path completion in
tests/test_completion/test_completion_path.py.The file already had a Bash completion test, but no zsh-specific assertion. This test checks that Path completion returns the
_filessignal for zsh.Tested locally with: