test_lazy_choices_help fails on Python 3.14
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- cli, testing-qa
Línea de trabajo
Comienza con tests/test_cli_utils.py::test_lazy_choices_help y reproduce el fallo usando Python 3.14 y los comandos uv indicados. Sigue la inicialización de ArgumentParser y LazyChoices para averiguar por qué getter se llama demasiado pronto y, después, haz que el test pase sin cambiar su comportamiento lazy esperado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Checklist
- I've searched for similar issues.
- I'm using the latest version of HTTPie (from git HEAD)
Minimal reproduction code and steps
This is with Python 3.14.0b3 and b4 alike.
uv venv --python=python3.14 venv
. venv/bin/activate
uv pip install '.[dev]'
uv pip install -U httpbin flask werkzeug # to support Python 3.14
python -m pytest --verbose -k test_lazy_choices_help
Current result
============================= test session starts ==============================
platform linux -- Python 3.14.0b3, pytest-8.4.1, pluggy-1.6.0 -- .../httpie/venv/bin/python
cachedir: .pytest_cache
rootdir: .../httpie
configfile: pytest.ini
plugins: mock-3.14.1, httpbin-2.1.0, cov-6.2.1
collecting ... collected 1028 items / 1027 deselected / 1 selected
tests/test_cli_utils.py::test_lazy_choices_help FAILED [100%]
=================================== FAILURES ===================================
____________________________ test_lazy_choices_help ____________________________
self = <Mock name='mock.getter' id='140611738470112'>
def assert_not_called(self):
"""assert that the mock was never called.
"""
if self.call_count != 0:
msg = ("Expected '%s' to not have been called. Called %s times.%s"
% (self._mock_name or 'mock',
self.call_count,
self._calls_repr()))
> raise AssertionError(msg)
E AssertionError: Expected 'getter' to not have been called. Called 1 times.
E Calls: [call()].
/usr/lib64/python3.14/unittest/mock.py:946: AssertionError
During handling of the above exception, another exception occurred:
def test_lazy_choices_help():
mock = Mock()
getter = mock.getter
getter.return_value = ['a', 'b', 'c']
help_formatter = mock.help_formatter
help_formatter.return_value = '<my help>'
parser = ArgumentParser()
parser.register('action', 'lazy_choices', LazyChoices)
parser.add_argument(
'--lazy-option',
default='a',
metavar='SYMBOL',
action='lazy_choices',
getter=getter,
help_formatter=help_formatter,
cache=False # for test purposes
)
# Parser initialization doesn't call it.
> getter.assert_not_called()
E AssertionError: Expected 'getter' to not have been called. Called 1 times.
E Calls: [call()].
tests/test_cli_utils.py:73: AssertionError
=============================== warnings summary ===============================
httpie/cli/definition.py:526
.../httpie/httpie/cli/definition.py:526: PendingDeprecationWarning: FileType is deprecated. Simply open files after parsing arguments.
type=FileType('a+b'),
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_cli_utils.py::test_lazy_choices_help - AssertionError: Expe...
================ 1 failed, 1027 deselected, 1 warning in 0.20s =================
Expected result
Tests pass.
- Lenguaje dominante
- Python
- Estrellas
- 38.6k
- Forks
- 4k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de httpie/cli
-
new
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug new
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
argparser.py: HTTPieArgumentParser has high cyclomatic complexity and mixed responsibilities Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de httpie/cli
Issues similares
-
bug priority:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
NousResearch/hermes-agent#122386 · 1 comentario ·
-
ai-generated
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vllm-project/production-stack#1105 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100