@@ -51,6 +51,7 @@ def test_from_buffer(self):
51
51
iterator = True , encoding = 'utf-8' )
52
52
df = rdr .read ()
53
53
tm .assert_frame_equal (df , df0 , check_exact = False )
54
+ rdr .close ()
54
55
55
56
def test_from_iterator (self ):
56
57
for j in 0 , 1 :
@@ -62,6 +63,7 @@ def test_from_iterator(self):
62
63
tm .assert_frame_equal (df , df0 .iloc [0 :2 , :])
63
64
df = rdr .read (3 )
64
65
tm .assert_frame_equal (df , df0 .iloc [2 :5 , :])
66
+ rdr .close ()
65
67
66
68
def test_iterator_loop (self ):
67
69
# github #13654
@@ -74,6 +76,7 @@ def test_iterator_loop(self):
74
76
for x in rdr :
75
77
y += x .shape [0 ]
76
78
self .assertTrue (y == rdr .row_count )
79
+ rdr .close ()
77
80
78
81
def test_iterator_read_too_much (self ):
79
82
# github #14734
@@ -82,9 +85,12 @@ def test_iterator_read_too_much(self):
82
85
rdr = pd .read_sas (fname , format = "sas7bdat" ,
83
86
iterator = True , encoding = 'utf-8' )
84
87
d1 = rdr .read (rdr .row_count + 20 )
88
+ rdr .close ()
89
+
85
90
rdr = pd .read_sas (fname , iterator = True , encoding = "utf-8" )
86
91
d2 = rdr .read (rdr .row_count + 20 )
87
92
tm .assert_frame_equal (d1 , d2 )
93
+ rdr .close ()
88
94
89
95
90
96
def test_encoding_options ():
0 commit comments