Save SVG test directly to file instead of its name. #7668

Merged
merged 1 commit into from Dec 23, 2016
@@ -217,8 +217,8 @@ def test_missing_psfont(mock):
rc('text', usetex=True)
fig, ax = plt.subplots()
ax.text(0.5, 0.5, 'hello')
- with tempfile.NamedTemporaryFile(suffix='.svg') as tmpfile:
- fig.savefig(tmpfile.name)
+ with tempfile.TemporaryFile() as tmpfile:
+ fig.savefig(tmpfile, format='svg')
if __name__ == '__main__':