Make 'no such option' assertion tolerant of newer click error format#5009
Open
GuillemSeCa wants to merge 1 commit into
Open
Make 'no such option' assertion tolerant of newer click error format#5009GuillemSeCa wants to merge 1 commit into
GuillemSeCa wants to merge 1 commit into
Conversation
click >= 8.2 changed the unknown-option error message from
'Error: No such option: --foo'
to
'Error: No such option '--foo'. (Did you mean ...)'
This broke tests/scancode/test_cli.py::test_scan_errors_out_with_unknown_option
on the *_latest_from_pip CI matrix (ubuntu22/24, macos14, win2019/2022).
Relax the assertion to check for the stable substrings ('no such option'
and the offending option name) instead of the exact phrasing, so the
test works with both click < 8.2 and click >= 8.2.
Signed-off-by: Guillem Serra Cazorla <guillem@meta.com>
6 tasks
Author
|
I saw the CI was slow so I also made this optional PR to speed it up 1 order of magnitude: #5013 |
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.
Fixes the
*_latest_from_pipCI matrix (ubuntu22/24, macos14, win2019/2022) which currently fails ondevelopbecause click 8.2 changed the unknown-option error message format:Error: No such option: --fooError: No such option '--foo'. (Did you mean ...)The test now asserts the stable substrings (
no such option,--json--info) instead of the exact phrasing, so it works with both versions.Verified locally: passes with click 8.3.1.