Title: test_dpi_ratio_change fails on Windows/Qt5Agg · Issue #16123 · matplotlib/matplotlib · GitHub
Open Graph Title: test_dpi_ratio_change fails on Windows/Qt5Agg · Issue #16123 · matplotlib/matplotlib
X Title: test_dpi_ratio_change fails on Windows/Qt5Agg · Issue #16123 · matplotlib/matplotlib
Description: ================================== FAILURES =================================== ____________________________ test_dpi_ratio_change ____________________________ [gw0] win32 -- Python 3.6.7 c:\miniconda36-x64\envs\test-environment\python.e...
Open Graph Description: ================================== FAILURES =================================== ____________________________ test_dpi_ratio_change ____________________________ [gw0] win32 -- Python 3.6.7 c:\minico...
X Description: ================================== FAILURES =================================== ____________________________ test_dpi_ratio_change ____________________________ [gw0] win32 -- Python 3.6.7 c:\minico...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16123
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_dpi_ratio_change fails on Windows/Qt5Agg","articleBody":"```\r\n================================== FAILURES ===================================\r\n____________________________ test_dpi_ratio_change ____________________________\r\n[gw0] win32 -- Python 3.6.7 c:\\miniconda36-x64\\envs\\test-environment\\python.exe\r\n @pytest.mark.backend('Qt5Agg')\r\n def test_dpi_ratio_change():\r\n \"\"\"\r\n Make sure that if _dpi_ratio changes, the figure dpi changes but the\r\n widget remains the same physical size.\r\n \"\"\"\r\n \r\n prop = 'matplotlib.backends.backend_qt5.FigureCanvasQT._dpi_ratio'\r\n \r\n with mock.patch(prop, new_callable=mock.PropertyMock) as p:\r\n \r\n p.return_value = 3\r\n \r\n fig = plt.figure(figsize=(5, 2), dpi=120)\r\n qt_canvas = fig.canvas\r\n qt_canvas.show()\r\n \r\n from matplotlib.backends.backend_qt5 import qApp\r\n \r\n # Make sure the mocking worked\r\n assert qt_canvas._dpi_ratio == 3\r\n \r\n size = qt_canvas.size()\r\n \r\n qt_canvas.manager.show()\r\n qt_canvas.draw()\r\n qApp.processEvents()\r\n \r\n # The DPI and the renderer width/height change\r\n assert fig.dpi == 360\r\n assert qt_canvas.renderer.width == 1800\r\n assert qt_canvas.renderer.height == 720\r\n \r\n # The actual widget size and figure physical size don't change\r\n assert size.width() == 600\r\n assert size.height() == 240\r\n assert qt_canvas.get_width_height() == (600, 240)\r\n assert (fig.get_size_inches() == (5, 2)).all()\r\n \r\n p.return_value = 2\r\n \r\n assert qt_canvas._dpi_ratio == 2\r\n \r\n qt_canvas.draw()\r\n qApp.processEvents()\r\n # this second processEvents is required to fully run the draw.\r\n # On `update` we notice the DPI has changed and trigger a\r\n # resize event to refresh, the second processEvents is\r\n # required to process that and fully update the window sizes.\r\n qApp.processEvents()\r\n \r\n # The DPI and the renderer width/height change\r\n assert fig.dpi == 240\r\n assert qt_canvas.renderer.width == 1200\r\n\u003e assert qt_canvas.renderer.height == 480\r\nE assert 474.0 == 480\r\nE + where 474.0 = \u003cmatplotlib.backends.backend_agg.RendererAgg object at 0x000000CC215AE2B0\u003e.height\r\n```\r\nBuild log: https://ci.appveyor.com/project/Kojoley/matplotlib/builds/29921850/job/1rdi7tiyqly53n3h","author":{"url":"https://github.com/Kojoley","@type":"Person","name":"Kojoley"},"datePublished":"2020-01-06T14:24:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/16123/matplotlib/issues/16123"}
| 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:afc0ca81-e4e7-be70-ff44-c5e481569d8f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9918:2D523B:2555CC9:33124DE:6A53A87E |
| html-safe-nonce | ee90fd62e4b691564e85d1d23a5765dd06d83e33f2224af444186f10d32c6e1a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTE4OjJENTIzQjoyNTU1Q0M5OjMzMTI0REU6NkE1M0E4N0UiLCJ2aXNpdG9yX2lkIjoiNDA1MDI0NDY3NDA1MjY2MzQyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4a3a53a3d01c388721af3e8363842d930b1af4e00f3aecce5a45f6f677be230 |
| hovercard-subject-tag | issue:545753348 |
| 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/16123/issue_layout |
| twitter:image | https://opengraph.githubassets.com/16943eb0b3a8f40c1164dd664fd5d168d0a81912a6b93a7a4c3109a6e61c7280/matplotlib/matplotlib/issues/16123 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/16943eb0b3a8f40c1164dd664fd5d168d0a81912a6b93a7a4c3109a6e61c7280/matplotlib/matplotlib/issues/16123 |
| og:image:alt | ================================== FAILURES =================================== ____________________________ test_dpi_ratio_change ____________________________ [gw0] win32 -- Python 3.6.7 c:\minico... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Kojoley |
| 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