Skip to content

Fix test_lazy_choices_help failure on Python 3.14+ #1643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jul 10, 2025

Python started raise early errors for invalid help strings, effectively triggering our LazyChoices action to query the options when added.

By using a custom ArgumentParser subclass that disables this check, LazyChoices works as intended.

Note that in real httpie code,
all argument parsing is done via BaseHTTPieArgumentParser subclasses, so this fixes the problem in httpie as well as in the tests.

Directly using BaseHTTPieArgumentParser in test_lazy_choices_help is not trivial, as it would require more setup.

Fixes #1641

Python started raise early errors for invalid help strings,
effectively triggering our LazyChoices action to query the options
when added.

By using a custom ArgumentParser subclass that disables this check,
LazyChoices works as intended.

Note that in real httpie code,
all argument parsing is done via BaseHTTPieArgumentParser subclasses,
so this fixes the problem in httpie as well as in the tests.

Directly using BaseHTTPieArgumentParser in test_lazy_choices_help
is not trivial, as it would require more setup.

Fixes httpie#1641
@hroncok
Copy link
Contributor Author

hroncok commented Jul 10, 2025

Python 3.7 CI is failing because that Python is no longer available.

@hroncok
Copy link
Contributor Author

hroncok commented Jul 10, 2025

test_cli_utils.py seems to pass. All the other failures are unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_lazy_choices_help fails on Python 3.14
1 participant