File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ def test_from_buffer(self):
44
44
df0 = self .data [j ]
45
45
for k in self .test_ix [j ]:
46
46
fname = os .path .join (self .dirpath , "test%d.sas7bdat" % k )
47
- byts = open (fname , 'rb' ).read ()
47
+ with open (fname , 'rb' ) as f :
48
+ byts = f .read ()
48
49
buf = io .BytesIO (byts )
49
50
df = pd .read_sas (buf , format = "sas7bdat" , encoding = 'utf-8' )
50
51
tm .assert_frame_equal (df , df0 , check_exact = False )
@@ -54,7 +55,8 @@ def test_from_iterator(self):
54
55
df0 = self .data [j ]
55
56
for k in self .test_ix [j ]:
56
57
fname = os .path .join (self .dirpath , "test%d.sas7bdat" % k )
57
- byts = open (fname , 'rb' ).read ()
58
+ with open (fname , 'rb' ) as f :
59
+ byts = f .read ()
58
60
buf = io .BytesIO (byts )
59
61
rdr = pd .read_sas (buf , format = "sas7bdat" ,
60
62
iterator = True , encoding = 'utf-8' )
You can’t perform that action at this time.
0 commit comments