Skip to content

Commit 2ca929b

Browse files
committed
TST: test for to_csv to succeed with deprecated options (GH3701)
1 parent 16b28f1 commit 2ca929b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

RELEASE.rst

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ pandas 0.11.1
178178
- ``convert_objects`` with ``convert_dates='coerce'`` was parsing some single-letter strings
179179
into today's date
180180
- ``DataFrame.from_records`` did not accept empty recarrays (GH3682_)
181+
- ``DataFrame.to_csv`` will succeed with the deprecated option ``nanRep``, @tdsmith
181182

182183
.. _GH3164: https://github.com/pydata/pandas/issues/3164
183184
.. _GH2786: https://github.com/pydata/pandas/issues/2786

pandas/tests/test_frame.py

+10
Original file line numberDiff line numberDiff line change
@@ -4726,6 +4726,16 @@ def test_float_none_comparison(self):
47264726

47274727
self.assertRaises(TypeError, df.__eq__, None)
47284728

4729+
def test_to_csv_deprecated_options(self):
4730+
4731+
pname = '__tmp_to_csv_deprecated_options__'
4732+
with ensure_clean(pname) as path:
4733+
4734+
self.tsframe[1:3] = np.nan
4735+
self.tsframe.to_csv(path, nanRep='foo')
4736+
recons = read_csv(path,index_col=0,parse_dates=[0],na_values=['foo'])
4737+
assert_frame_equal(self.tsframe, recons)
4738+
47294739
def test_to_csv_from_csv(self):
47304740

47314741
pname = '__tmp_to_csv_from_csv__'

0 commit comments

Comments
 (0)