Remove axes in ROI tests (these cause travis failures)

This commit is contained in:
Luke Campagnola 2016-07-18 08:13:25 -07:00
parent f32dce7908
commit 0d131e4be4
2 changed files with 11 additions and 7 deletions

View File

@ -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)

View File

@ -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