Title: TST: Any loaded backend may break CallbackRegistry exception tests · Issue #31049 · matplotlib/matplotlib · GitHub
Open Graph Title: TST: Any loaded backend may break CallbackRegistry exception tests · Issue #31049 · matplotlib/matplotlib
X Title: TST: Any loaded backend may break CallbackRegistry exception tests · Issue #31049 · matplotlib/matplotlib
Description: While looking at #31031, I noticed that sometimes, the test that was supposed to fail didn't. Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What happens is, if there is no running GUI toolki...
Open Graph Description: While looking at #31031, I noticed that sometimes, the test that was supposed to fail didn't. Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What happe...
X Description: While looking at #31031, I noticed that sometimes, the test that was supposed to fail didn't. Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What h...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31049
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TST: Any loaded backend may break CallbackRegistry exception tests","articleBody":"While looking at #31031, I noticed that sometimes, [the test that was supposed to fail _didn't_](https://github.com/matplotlib/matplotlib/pull/31031#issuecomment-3816570448). Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What happens is, if there is no running GUI toolkit, then an exception in a callback will raise:\nhttps://github.com/matplotlib/matplotlib/blob/10ee372203f424d6dbc8a566e7586d1c6854e0ec/lib/matplotlib/cbook.py#L112-L116\nIf a test with Qt runs, though, then it will count as running _forever_:\nhttps://github.com/matplotlib/matplotlib/blob/10ee372203f424d6dbc8a566e7586d1c6854e0ec/lib/matplotlib/cbook.py#L62-L109\nUnlike, e.g., GTK, all that's required is that an application instance is connected, so this is permanent.\n\nIf there are tests that check exceptions, this would be noticed rather quickly. However, in the linked case, the test is more of a _negative_ check, trying to prove that no exception occurs. The problem here is that we may in the future _silently_ break any such test, since an exception that should have occurred may not raise after Qt is loaded.\n\nProbably the simplest fix is to move _any_ test that uses a backend explicitly into a subprocess. But I did not count how many that would be and whether that might cause an undue burden on testing infrastructure.","author":{"url":"https://github.com/QuLogic","@type":"Person","name":"QuLogic"},"datePublished":"2026-01-30T00:15:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/31049/matplotlib/issues/31049"}
| 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:5d36e1cf-e848-513a-f138-6302678064f9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E218:2D5E27:11CDCE7:183D688:6A5216AE |
| html-safe-nonce | fd404aac7f654e4b00a4f970e82f0e0a762c62283414fe6d099e0de117958ae5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjE4OjJENUUyNzoxMUNEQ0U3OjE4M0Q2ODg6NkE1MjE2QUUiLCJ2aXNpdG9yX2lkIjoiNDM1MTM1MzEwNDc4ODQxNTE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5bd2e3b76cfdc59432f22a1d20c58f6c1c5917b52448b8b2a7e444ebeb348028 |
| hovercard-subject-tag | issue:3873186451 |
| 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/31049/issue_layout |
| twitter:image | https://opengraph.githubassets.com/652c3c9d8353beaba2b2ebe5409c65052353acb00afe102f14da2533ea4bc4c9/matplotlib/matplotlib/issues/31049 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/652c3c9d8353beaba2b2ebe5409c65052353acb00afe102f14da2533ea4bc4c9/matplotlib/matplotlib/issues/31049 |
| og:image:alt | While looking at #31031, I noticed that sometimes, the test that was supposed to fail didn't. Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What happe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | QuLogic |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width