Title: [Bug]: triage_tests.py is brittle against failures in test modules that have only check_figures_equal test · Issue #29774 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: triage_tests.py is brittle against failures in test modules that have only check_figures_equal test · Issue #29774 · matplotlib/matplotlib
X Title: [Bug]: triage_tests.py is brittle against failures in test modules that have only check_figures_equal test · Issue #29774 · matplotlib/matplotlib
Description: 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_...
Open Graph Description: 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_p...
X Description: 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 f...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29774
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: triage_tests.py is brittle against failures in test modules that have only check_figures_equal test","articleBody":"### Bug summary\n\nIf 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\".\n\n### Code for reproduction\n\n```Python\nMake 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.\n```\n\n### Actual outcome\n\nValueError: Can't find baseline dir for test_pickle\n\n### Expected outcome\n\nThe test triager succeeds.\n\n### Additional information\n\nFixing 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):\n```patch\ndiff --git i/tools/triage_tests.py w/tools/triage_tests.py\nindex 5153b1c712..6df720f29d 100644\n--- i/tools/triage_tests.py\n+++ w/tools/triage_tests.py\n@@ -263,7 +263,7 @@ class Entry:\n ]\n self.thumbnails = [self.dir / x for x in self.thumbnails]\n\n- if not Path(self.destdir, self.generated).exists():\n+ if self.destdir is None or not Path(self.destdir, self.generated).exists():\n # This case arises from a check_figures_equal test.\n self.status = 'autogen'\n elif ((self.dir / self.generated).read_bytes()\n@@ -281,7 +281,6 @@ class Entry:\n path = self.source / baseline_dir / reldir\n if path.is_dir():\n return path\n- raise ValueError(f\"Can't find baseline dir for {reldir}\")\n\n @property\n def display(self):\n```\n\nOpening as an issue because I don't really mind about which solution to pick, so I'll let whoever cares pick one.\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.11.0.dev525+g9f7b3dd205\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n3.13\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2025-03-18T23:17:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/29774/matplotlib/issues/29774"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:47409654-9581-cfd1-8879-7183e5c0bb29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0AA:3C82F7:4A64E1:643F65:6A529730 |
| html-safe-nonce | 207df6caf94ceb1452d2dce98d96555c3d0faa3030bfe38c66f0915b8f2d4d9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEFBOjNDODJGNzo0QTY0RTE6NjQzRjY1OjZBNTI5NzMwIiwidmlzaXRvcl9pZCI6IjgyNjA1Nzc4Nzg1NDgzMjIwOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 795baaaeec6a169e09890bbae98c7fd4b32b457ba7323c64f4153dc3ab9d8fdb |
| hovercard-subject-tag | issue:2930051142 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29774/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db624260cb8258833d0bc03ac382bd734a24987faf4c60004e8017249c941196/matplotlib/matplotlib/issues/29774 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db624260cb8258833d0bc03ac382bd734a24987faf4c60004e8017249c941196/matplotlib/matplotlib/issues/29774 |
| og:image:alt | 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_p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width