Skip to content

TST: testing fails with minimal test requirements #17681

Closed

Description

@neutrinoceros

For some reason the bump to pytest==8.0.0 (#17675) appears to impact test discovery.
This is visible when running with truly pinned oldest test dependencies (#16963), and a periodic reminder that this PR serves a purpose and should be merged sooner rather than later to avoid discovering these issues after the fact (this should have been caught in #17655

example logs
What seems to be happening is that doctests from astropy/extern/configobj/validate.py are not compatible with pytest (they seem to be written with only python -m doctest in mind), which is normally not an issue since this module is somehow excluded from test discovery, but in that specific env (exactly our minimal dependencies), this isn't true, which leads to failing the run.

Further bumping pytest to a bugfix release might remedy this, but it's also possible that something else in our minimal set of test dependencies affects discovery (tox, coverage ?) is just not compatible with pytest 8.0 and might need a bump too. I'll run some experiments on my fork to see how best to address this.

Activity

  1. added
    Affects-devPRs and issues that do not impact an existing Astropy release
    on Jan 28, 2025
  2. changed the title [-]TST: testing fail with minimal test requirements[/-] [+]TST: testing fails with minimal test requirements[/+] on Jan 28, 2025
  3. neutrinoceros commented on Jan 28, 2025

    @neutrinoceros
    ContributorAuthor

    Preliminary results seem to indicate that it is sufficient to bump pytest-doctestplus too. Version 1.2.1 appears to be sufficient, but I'll try to restrict it as far back as possible.

  4. pllim commented on Jan 28, 2025

    @pllim
    Member

    Why is pytest not respecting this setting?

    "astropy[\\/]extern",

  5. neutrinoceros commented on Jan 28, 2025

    @neutrinoceros
    ContributorAuthor

    best guess so far: because pytest-doctestplus takes part in test collection and used to be incompatible with this setting
    xref scientific-python/pytest-doctestplus#201

    Your PR was first ship with pytest-doctestplus 0.13, but unfortunately this doesn't seem to play nice with pytest 8.0.0 (or to put it differently, it is broken by pytest 8.0.0), hence my conclusion that we need version 1.0.0 or newer.

  6. pllim commented on Jan 28, 2025

    @pllim
    Member

    So apparently Past-Self fixed it, then it came back, and then fixed again in 1.0? 🧐

    That is weird because doctestplus tests against a whole slew of sphinx versions. I added a test in the PR you linked. And I don't ever remember that test failing lately.

  7. neutrinoceros commented on Jan 28, 2025

    @neutrinoceros
    ContributorAuthor

    I don't know what other pytest plugin might interfere with test collection, but it's seems plausible that our current set of minimal requirements doesn't correspond to anything exact that got tested in the past (as some packages are pinned to older versions than others), so maybe something managed to slip through the net despite everyone's best efforts.

  8. added this to the v7.1.0 milestone on Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Affects-devPRs and issues that do not impact an existing Astropy releaseDocstesting

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions