Fixed bug in unit test where temp file remained open when os.unlink was called (#832)
This commit is contained in:
parent
20c74954a5
commit
8420fe984a
@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
SVG export test
|
CSV export test
|
||||||
"""
|
"""
|
||||||
from __future__ import division, print_function, absolute_import
|
from __future__ import division, print_function, absolute_import
|
||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
@ -33,8 +33,9 @@ def test_CSVExporter():
|
|||||||
ex = pg.exporters.CSVExporter(plt.plotItem)
|
ex = pg.exporters.CSVExporter(plt.plotItem)
|
||||||
ex.export(fileName=tempfilename)
|
ex.export(fileName=tempfilename)
|
||||||
|
|
||||||
r = csv.reader(open(tempfilename, 'r'))
|
with open(tempfilename, 'r') as csv_file:
|
||||||
lines = [line for line in r]
|
r = csv.reader(csv_file)
|
||||||
|
lines = [line for line in r]
|
||||||
header = lines.pop(0)
|
header = lines.pop(0)
|
||||||
assert header == ['myPlot_x', 'myPlot_y', 'x0001', 'y0001', 'x0002', 'y0002']
|
assert header == ['myPlot_x', 'myPlot_y', 'x0001', 'y0001', 'x0002', 'y0002']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user