Tests fail with pytest 9

Abierto Apto para principiantes
#87 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

Empieza por tests/test_update_examples_dir.py y example/test_example.py, donde la recopilación falla porque la parametrización recibe generadores. Lee la configuración de la parametrización en ambas pruebas y consulta las indicaciones sobre la deprecación de pytest 9 incluidas en el informe. El trabajo estará terminado cuando se recopilen ambas pruebas y la suite se ejecute sin la PytestRemovedIn10Warning indicada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The following came up when building version 0.0.18 in Arch Linux, with pytest 9.1.1:

============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.7.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /build/python-pytest-examples/src/pytest-examples-0.0.18
configfile: pyproject.toml
testpaths: tests, example
plugins: examples-0.0.18, platformdirs-4.13.0
collecting ... collected 66 items / 2 errors

==================================== ERRORS ====================================
______________ ERROR collecting tests/test_update_examples_dir.py ______________
/usr/lib/python3.14/site-packages/pluggy/_caller.py:197: in __call__
    return self._hookexec(
/usr/lib/python3.14/site-packages/pluggy/_manager.py:183: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:250: in pytest_pycollect_makeitem
    return list(collector._genfunctions(name, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:476: in _genfunctions
    self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
/usr/lib/python3.14/site-packages/pluggy/_caller.py:262: in call_extra
    return self._hookexec(self.name, hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/pluggy/_manager.py:183: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:124: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker)
/usr/lib/python3.14/site-packages/_pytest/python.py:1316: in parametrize
    argnames, parametersets = ParameterSet._for_parametrize(
/usr/lib/python3.14/site-packages/_pytest/mark/structures.py:202: in _for_parametrize
    warnings.warn(
E   pytest.PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
E   Test: tests/test_update_examples_dir.py::test_cases_update, argvalues type: generator
E   Please convert to a list or tuple.
E   See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
___________________ ERROR collecting example/test_example.py ___________________
/usr/lib/python3.14/site-packages/pluggy/_caller.py:197: in __call__
    return self._hookexec(
/usr/lib/python3.14/site-packages/pluggy/_manager.py:183: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:250: in pytest_pycollect_makeitem
    return list(collector._genfunctions(name, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:476: in _genfunctions
    self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
/usr/lib/python3.14/site-packages/pluggy/_caller.py:262: in call_extra
    return self._hookexec(self.name, hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/pluggy/_manager.py:183: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/site-packages/_pytest/python.py:124: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker)
/usr/lib/python3.14/site-packages/_pytest/python.py:1316: in parametrize
    argnames, parametersets = ParameterSet._for_parametrize(
/usr/lib/python3.14/site-packages/_pytest/mark/structures.py:202: in _for_parametrize
    warnings.warn(
E   pytest.PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
E   Test: example/test_example.py::test_will_error, argvalues type: generator
E   Please convert to a list or tuple.
E   See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
=========================== short test summary info ============================
ERROR tests/test_update_examples_dir.py - pytest.PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
Test: tests/test_update_examples_dir.py::test_cases_update, argvalues type: generator
Please convert to a list or tuple.
See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
ERROR example/test_example.py - pytest.PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
Test: example/test_example.py::test_will_error, argvalues type: generator
Please convert to a list or tuple.
See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 0.44s ===============================
Lenguaje dominante
Python
Estrellas
181
Forks
29
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pydantic/pytest-examples

Todos los issues de pydantic/pytest-examples

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.