Skip to content

Commit 8e144c7

Browse files
author
y-p
committed
TST: refurbished to_csv ignores file mode GH3263
1 parent 16027f9 commit 8e144c7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/test_frame.py

+14
Original file line numberDiff line numberDiff line change
@@ -4600,6 +4600,20 @@ def test_to_csv_from_csv(self):
46004600
self.assertRaises(ValueError, self.frame2.to_csv, path,
46014601
header=['AA', 'X'])
46024602

4603+
with ensure_clean(pname) as path:
4604+
import pandas as pd
4605+
df1 = DataFrame(np.random.randn(3, 1))
4606+
df2 = DataFrame(np.random.randn(3, 1))
4607+
4608+
df1.to_csv(path)
4609+
df2.to_csv(path,mode='a',header=False)
4610+
xp = pd.concat([df1,df2])
4611+
rs = pd.read_csv(path,index_col=0)
4612+
rs.columns = map(int,rs.columns)
4613+
xp.columns = map(int,xp.columns)
4614+
assert_frame_equal(xp,rs)
4615+
4616+
46034617
@slow
46044618
def test_to_csv_moar(self):
46054619
from pandas.util.testing import makeCustomDataframe as mkdf

0 commit comments

Comments
 (0)