Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2679ddd

Browse filesBrowse files
committed
Save SVG test directly to file instead of its name.
Windows doesn't like opening files twice, so this needs to save to the file name _outside_ the context (after it's been closed), or simply write to the file object directly. There doesn't seem to be any pressing need to use the file name, so just use the file object.
1 parent 7131876 commit 2679ddd
Copy full SHA for 2679ddd

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/tests/test_backend_svg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_svg.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ def test_missing_psfont(mock):
217217
rc('text', usetex=True)
218218
fig, ax = plt.subplots()
219219
ax.text(0.5, 0.5, 'hello')
220-
with tempfile.NamedTemporaryFile(suffix='.svg') as tmpfile:
221-
fig.savefig(tmpfile.name)
220+
with tempfile.TemporaryFile() as tmpfile:
221+
fig.savefig(tmpfile, format='svg')
222222

223223

224224
if __name__ == '__main__':

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.