From 0bdc89fa69828dbed6ee02aac93bf97079dd8c84 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sun, 14 Feb 2016 14:28:13 -0800 Subject: [PATCH] correction for plotcurveitem tests on osx --- pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py b/pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py index 17f5894b..a3c34b11 100644 --- a/pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/tests/test_PlotCurveItem.py @@ -5,6 +5,7 @@ from pyqtgraph.tests import assertImageApproved def test_PlotCurveItem(): p = pg.GraphicsWindow() + p.ci.layout.setContentsMargins(4, 4, 4, 4) # default margins vary by platform v = p.addViewBox() p.resize(200, 150) data = np.array([1,4,2,3,np.inf,5,7,6,-np.inf,8,10,9,np.nan,-1,-2,0]) @@ -14,7 +15,7 @@ def test_PlotCurveItem(): # Check auto-range works. Some platform differences may be expected.. checkRange = np.array([[-1.1457564053237301, 16.145756405323731], [-3.076811473165955, 11.076811473165955]]) - assert np.all(np.abs(np.array(v.viewRange()) - checkRange) < 0.1) + assert np.allclose(v.viewRange(), checkRange) assertImageApproved(p, 'plotcurveitem/connectall', "Plot curve with all points connected.")