Skip to content

TST: cosmology test classes not compatible with pytest 10 #19742

Closed

Description

@pllim

Example log (devinfra job): https://github.com/astropy/astropy/actions/runs/25875214616/job/76040503717

Reason: https://docs.pytest.org/en/latest/deprecations.html#class-scoped-fixture-as-instance-method

Recommendation: Author of original test (@nstarman) should find a way to simplify the affected cosmology tests so they do not emit warnings in pytest 9.1 to be compatible with pytest 10. Maybe we do not need so many levels of inheritance and setup_class?

If this is not addressed in a timely manner, we would need to either max pin pytest or disable the offending tests, none of which are desirable.

There are a lot of tests affected. To illustrated the problem, I am just going to focus on one here

  1. Install pytest-dev from https://github.com/pytest-dev/pytest

  2. To get past the confusing error, comment out this line (we can deal with that later)

  1. pytest astropy/cosmology/_src/tests/flrw/test_flrw.py -k test_comoving_distance_example -v (running everything takes too long and gives too long a traceback)

Thank you for your attention.

Activity

  1. pllim commented on May 14, 2026

    @pllim
    MemberAuthor

    From a quick experiment in #19743 , looks like only cosmology is affected by this.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions