Skip to content

TST: Use shapes instead of actual text for layout manager tests #29825

@jklymak

Description

@jklymak

If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults.

Originally posted by @tacaswell in #16447

Currently the layout managers main job is to avoid overwriting text between subplots on a page. They currently use image tests to check that this works, and those image tests change a fair bit if kerning or glyphs change in the font management.

I think most, if not all, of these tests could be changed to replace the text with shapes. Maybe even automatically - eg instead of "remove text" we have "shapify-text", where it gets a nominal text size from rcParams and makes a nominal shape in the correct spot of the correct, but nominal, size. eg it does not use the actual size of any text elements as rendered, but says its 12-pt font, x characters, so we make a box that is 14 points by 13*x points large centered where the label should go. If these tests were made deterministic this way, then they could even possibly drop the image tests and just test the position of the axes, which is what the layout engines do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy