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

Skip to content

Commit 884334d

Browse files
committed
TST: add extra processEvents call in test
The resizeEvent call does put another paint onto the event queue, however it seems that processEvents only processes events on the queue when it is called (not events added while it is processing). This is not clearly documented, but makes sense as this method is for keeping GUIs responsive during otherwise long-running tasks so it should not be able to extend it's run indefinitely by populating the queue. This is required because a previous commit removed the explicit processEvents call in paintEvent as it would occasionally cause recursive painting which may kill Qt.
1 parent 7ff959c commit 884334d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/matplotlib/tests/test_backend_qt5.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def test_dpi_ratio_change():
145145

146146
qt_canvas.draw()
147147
qApp.processEvents()
148+
qApp.processEvents()
148149

149150
# The DPI and the renderer width/height change
150151
assert fig.dpi == 240

0 commit comments

Comments
 (0)