Skip to content

CI: The release of pytest 9.1.0 breaks tests. #31635

Closed

Description

@charris

Pytest 9.1.0 was released 6/13/2026 and breaks tests where it is pip installed without the pin
in the requirements files. I opened a pytest issue: pytest-dev/pytest#14592.

We might be able to fix some of those on the NumPy side, I haven't looked hard at our usage.

Activity

  1. changed the title [-]The release of pytest 3.1.0 breaks tests.[/-] [+]CI: The release of pytest 3.1.0 breaks tests.[/+] on Jun 13, 2026
  2. changed the title [-]CI: The release of pytest 3.1.0 breaks tests.[/-] [+]CI: The release of pytest 9.1.0 breaks tests.[/+] on Jun 13, 2026
  3. tylerjereddy commented on Jun 13, 2026

    @tylerjereddy
    Contributor

    It looks like these are just warnings about breaking changes in the upcoming pytest 10.x release series. SciPy has a few hundred errors related to these warnings too, and they almost all seem to just be the result of this one: https://docs.pytest.org/en/stable/deprecations.html#non-collection-iterables-in-pytest-mark-parametrize

    Which basically just requires conversions of "parametrize" arguments from generator/iterator type objects to "materialized" types like lists or tuples. A sample PR fixing up scipy.spatial I just did is at: scipy/scipy#25376

    I suppose you could also just suppress them and kick the can down the road until 10.x, although the conversion is pretty straightforward. I suppose an LLM might even be able to find most uses of generator-type objects in parametrized tests and convert them to lists or tuples.

  4. seberg commented on Jun 14, 2026

    @seberg
    Member

    Yeah, we have a couple of places that use generator functions, just to organize the code a bit and avoid list appending...
    I dunno why this deprecation is important, but I wonder if we should just add list() everwhere, build a list in those functions, or create a tiny @listify decorator (which could also apply @functools.cache)
    (Heck, you could do @lambda x: list(x) or @lambda x: lambda *args, **kwargs: list(x(*args, **kwargs)) but to me a lambda decorator looks like being too smart)

  5. charris commented on Jun 17, 2026

    @charris
    MemberAuthor

    We are now compatible with pytest 9.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions