Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TST: correct expected canvas sizes
The values in the test were the buggy values.  We expect a (5, 2) in
figure at 120 dpi to be (600, 240) screen pixels.
  • Loading branch information
tacaswell committed Aug 10, 2017
commit ce7c8df6084fc2fe10116453c0e88f1aac79199d
9 changes: 5 additions & 4 deletions lib/matplotlib/tests/test_backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def test_dpi_ratio_change():
size = qt_canvas.size()

qt_canvas.manager.show()
qt_canvas.draw()
qApp.processEvents()

# The DPI and the renderer width/height change
Expand All @@ -133,8 +134,8 @@ def test_dpi_ratio_change():
assert qt_canvas.renderer.height == 720

# The actual widget size and figure physical size don't change
assert size.width() == 200
assert size.height() == 80
assert size.width() == 600
assert size.height() == 240
assert_equal(qt_canvas.get_width_height(), (600, 240))
assert_equal(fig.get_size_inches(), (5, 2))

Expand All @@ -151,7 +152,7 @@ def test_dpi_ratio_change():
assert qt_canvas.renderer.height == 480

# The actual widget size and figure physical size don't change
assert size.width() == 200
assert size.height() == 80
assert size.width() == 600
assert size.height() == 240
assert_equal(qt_canvas.get_width_height(), (600, 240))
assert_equal(fig.get_size_inches(), (5, 2))