File tree 2 files changed +23
-13
lines changed
2 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -171,3 +171,26 @@ def test_read_table_buglet_4x_multiindex(self):
171
171
columns = list ('abcABC' ), index = list ('abc' ))
172
172
actual = self .read_table (StringIO (data ), sep = '\s+' )
173
173
tm .assert_frame_equal (actual , expected )
174
+
175
+ def test_temporary_file (self ):
176
+ # GH13398
177
+ data1 = """index,A,B,C,D
178
+ foo,2,3,4,5
179
+ bar,7,8,9,10
180
+ baz,12,13,14,15
181
+ qux,12,13,14,15
182
+ foo2,12,13,14,15
183
+ bar2,12,13,14,15
184
+ """
185
+ data2 = data1 .replace ("," , " " )
186
+
187
+ from tempfile import TemporaryFile
188
+ new_file = TemporaryFile ("w+" )
189
+ new_file .write (data2 )
190
+ new_file .flush ()
191
+ new_file .seek (0 )
192
+
193
+ result = self .read_csv (new_file , sep = r"\s+" , engine = "python" )
194
+ expected = self .read_csv (StringIO (data1 ))
195
+ tm .assert_frame_equal (result , expected )
196
+
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ class TestCommonIOCapabilities(tm.TestCase):
33
33
foo2,12,13,14,15
34
34
bar2,12,13,14,15
35
35
"""
36
- data2 = data1 .replace ("," , " " )
37
36
38
37
def test_expand_user (self ):
39
38
filename = '~/sometest'
@@ -91,18 +90,6 @@ def test_iterator(self):
91
90
expected .index = [0 for i in range (len (expected ))]
92
91
tm .assert_frame_equal (concat (it ), expected .iloc [1 :])
93
92
94
- def test_temporary_file (self ):
95
- # GH13398
96
- from tempfile import TemporaryFile
97
- new_file = TemporaryFile ("w+" )
98
- new_file .write (self .data2 )
99
- new_file .flush ()
100
- new_file .seek (0 )
101
-
102
- result = read_csv (new_file , sep = r"\s+" , engine = "python" )
103
- expected = read_csv (StringIO (self .data1 ))
104
- tm .assert_frame_equal (result , expected )
105
-
106
93
107
94
class TestMMapWrapper (tm .TestCase ):
108
95
You can’t perform that action at this time.
0 commit comments