Skip to content

[TST]: Add classic style to all old image tests. #24716

Closed

Description

@jklymak

Summary

All the old image tests use the classic style, whereas new test we ask contributors to add style='mpl20' to the image_comparison decorator.

@image_comparison('new_style.png', remove_text=True, style='mpl20')

As a first step to making the new style the testing default, we should go through and change all the old image comparison tests to explicitly use the classic style:

@image_comparison('old_style.png', style='classic')

This will hit a lot of the tests, but could be done piecemeal or all in one swoop if someone is clever with writing a parser to add the style kwarg.

Eventually the way to test that everything has been caught will be to change the default to 'mpl20' and make sure none of the image tests fail.

Activity

  1. timhoffm commented on Dec 13, 2022

    @timhoffm
    Member

    Already addressed in #24709.

  2. removed
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Dec 13, 2022
  3. jklymak commented on Dec 13, 2022

    @jklymak
    MemberAuthor

    Ooops, didn't see that, though I wonder if @oscargus would add the further detail here to his issue.

  4. oscargus commented on Dec 13, 2022

    @oscargus
    Member

    There are quite a lot of tests to modify, so I guess that it makes sense to have an issue until all are done and we can change the default style.

  5. rcomer commented on Dec 13, 2022

    @rcomer
    Member

    Would it be worth not having a default style, but instead make the style keyword mandatory? That would save someone from going through this loop again if we ever start using something newer than “mpl20”.

  6. jklymak commented on Dec 13, 2022

    @jklymak
    MemberAuthor

    @rcomer that seems like a reasonable plan to me.

  7. github-actions commented on Feb 9, 2026

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  8. added
    keepItems to be ignored by the “Stale” Github Action
    on Feb 9, 2026
  9. timhoffm commented on Feb 9, 2026

    @timhoffm
    Member

    IMHO new tests should be written with the default style at that time. It doesn't make a large difference whether we mandate an explicit style setting or whether we set the default to the current one and before switching to a new style, we set explicit values to all then-defaults. Tooling will make both relatively simple.

    What we should change: Currently 'classic' is the default style, which is bad. If somebody forgets to set the style, they'll add 'classic' reference images. So things to do here:

    • add 'classic' to all old image tests as suggested (this PR)
    • either switch the default to mpl20, or make it mandatory.
  10. 1 remaining item

  11. removed
    status: inactiveMarked by the “Stale” Github Action
    keepItems to be ignored by the “Stale” Github Action
    on Feb 13, 2026
  12. WeatherGod commented on Feb 13, 2026

    @WeatherGod
    Member

    Is it possible to have a linter check if new image comparison tests adds the style keyword?

  13. QuLogic commented on Feb 13, 2026

    @QuLogic
    Member

    No need, we just make it keyword-only without a default value, along with #31148.

  14. added a commit that references this issue on Feb 14, 2026
    85a4a72
  15. added 2 commits that reference this issue on Feb 25, 2026
    a18b014
    ec3a2df
  16. added 6 commits that reference this issue on Apr 10, 2026
    3f4bc2c
    de1e5d8
    04d995f
    45440d3
    7207881
    47f5e22
  17. added this to the v3.11.0 milestone on Apr 16, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions