Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: triage_tests.py is brittle against failures in test modules that have only check_figures_equal test #29774

Copy link
Copy link
Open
@anntzer

Description

@anntzer
Issue body actions

Bug summary

If a check_figures_equal test fails in test_pickle.py (which has no baseline image tests at all), then running triage_tests.py fails with "ValueError: Can't find baseline dir for test_pickle".

Code for reproduction

Make test_pickle::test_complete fail, e.g. by commenting out the `fig_test.figimage(loaded.canvas.renderer.buffer_rgba())` line; run that test (which should fail), and run tools/triage_tests.py.

Actual outcome

ValueError: Can't find baseline dir for test_pickle

Expected outcome

The test triager succeeds.

Additional information

Fixing involves either creating an empty test_pickle directory in the baseline_images directory, or allowing missing directories in triage_tests (which already interprets missing baselines as arising from check_figures_equal tests):

diff --git i/tools/triage_tests.py w/tools/triage_tests.py
index 5153b1c712..6df720f29d 100644
--- i/tools/triage_tests.py
+++ w/tools/triage_tests.py
@@ -263,7 +263,7 @@ class Entry:
             ]
         self.thumbnails = [self.dir / x for x in self.thumbnails]

-        if not Path(self.destdir, self.generated).exists():
+        if self.destdir is None or not Path(self.destdir, self.generated).exists():
             # This case arises from a check_figures_equal test.
             self.status = 'autogen'
         elif ((self.dir / self.generated).read_bytes()
@@ -281,7 +281,6 @@ class Entry:
             path = self.source / baseline_dir / reldir
             if path.is_dir():
                 return path
-        raise ValueError(f"Can't find baseline dir for {reldir}")

     @property
     def display(self):

Opening as an issue because I don't really mind about which solution to pick, so I'll let whoever cares pick one.

Operating system

No response

Matplotlib Version

3.11.0.dev525+g9f7b3dd205

Matplotlib Backend

No response

Python version

3.13

Jupyter version

No response

Installation

git checkout

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.