From e4254172a54db8adbddacf32298bdc1dd41453d5 Mon Sep 17 00:00:00 2001 From: Billy Su Date: Thu, 5 Apr 2018 11:13:58 +0800 Subject: [PATCH] Add test_clear for PlotDataItem class --- pyqtgraph/graphicsItems/tests/test_PlotDataItem.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyqtgraph/graphicsItems/tests/test_PlotDataItem.py b/pyqtgraph/graphicsItems/tests/test_PlotDataItem.py index 9a13c0b6..8851a0a2 100644 --- a/pyqtgraph/graphicsItems/tests/test_PlotDataItem.py +++ b/pyqtgraph/graphicsItems/tests/test_PlotDataItem.py @@ -49,3 +49,12 @@ def test_setData(): pdi.setData({'x': x, 'y': y}) assert len(pdi.xData) == 200 assert len(pdi.yData) == 200 + +def test_clear(): + y = list(np.random.normal(size=100)) + x = np.linspace(5, 10, 100) + pdi = pg.PlotDataItem(x, y) + pdi.clear() + + assert pdi.xData == None + assert pdi.yData == None