File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 5
5
from six import BytesIO
6
6
import glob
7
7
import os
8
- import shutil
9
8
import numpy as np
10
9
import pytest
11
10
12
11
from matplotlib .testing .decorators import image_comparison
13
12
from matplotlib import pyplot as plt
14
13
import matplotlib .cm as cm
15
- import tempfile
16
14
import sys
17
15
on_win = (sys .platform == 'win32' )
18
16
@@ -49,8 +47,8 @@ def test_imread_png_uint16():
49
47
assert np .sum (img .flatten ()) == 134184960
50
48
51
49
52
- def test_truncated_file ():
53
- d = tempfile . mkdtemp ( )
50
+ def test_truncated_file (tmpdir ):
51
+ d = tmpdir . mkdir ( 'test' )
54
52
fname = os .path .join (d , 'test.png' )
55
53
fname_t = os .path .join (d , 'test_truncated.png' )
56
54
plt .savefig (fname )
@@ -62,8 +60,6 @@ def test_truncated_file():
62
60
with pytest .raises (Exception ):
63
61
plt .imread (fname_t )
64
62
65
- shutil .rmtree (d )
66
-
67
63
68
64
def test_truncated_buffer ():
69
65
b = BytesIO ()
You can’t perform that action at this time.
0 commit comments