diff --git a/pyqtgraph/graphicsItems/tests/test_ROI.py b/pyqtgraph/graphicsItems/tests/test_ROI.py index 1fdf5bfb..973d8f1a 100644 --- a/pyqtgraph/graphicsItems/tests/test_ROI.py +++ b/pyqtgraph/graphicsItems/tests/test_ROI.py @@ -134,9 +134,13 @@ def test_PolyLineROI(): plt = pg.GraphicsView() plt.show() plt.resize(200, 200) - plt.plotItem = pg.PlotItem() - plt.scene().addItem(plt.plotItem) - plt.plotItem.resize(200, 200) + vb = pg.ViewBox() + plt.scene().addItem(vb) + vb.resize(200, 200) + #plt.plotItem = pg.PlotItem() + #plt.scene().addItem(plt.plotItem) + #plt.plotItem.resize(200, 200) + plt.scene().minDragTime = 0 # let us simulate mouse drags very quickly. @@ -145,9 +149,9 @@ def test_PolyLineROI(): QtTest.QTest.qWait(100) for r, name in rois: - plt.plotItem.clear() - plt.plotItem.addItem(r) - plt.plotItem.autoRange() + vb.clear() + vb.addItem(r) + vb.autoRange() app.processEvents() assertImageApproved(plt, 'roi/polylineroi/'+name+'_init', 'Init %s polyline.' % name) diff --git a/pyqtgraph/tests/image_testing.py b/pyqtgraph/tests/image_testing.py index c1ac4dd7..018896c2 100644 --- a/pyqtgraph/tests/image_testing.py +++ b/pyqtgraph/tests/image_testing.py @@ -281,7 +281,7 @@ def makePng(img): """Given an array like (H, W, 4), return a PNG-encoded byte string. """ io = QtCore.QBuffer() - qim = fn.makeQImage(img, alpha=False) + qim = fn.makeQImage(img.transpose(1, 0, 2), alpha=False) qim.save(io, 'PNG') png = bytes(io.data().data()) return png