Skip to content

Commit d91cec4

Browse files
committed
MAINT: Avoid to_datetime warnings in test_to_csv
1 parent 10bf721 commit d91cec4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/tests/frame/test_to_csv.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _to_uni(x):
291291
elif r_dtype == 'p':
292292
r_dtype = 'O'
293293
recons.index = np.array(
294-
list(map(Timestamp, recons.index.to_datetime())),
294+
list(map(Timestamp, to_datetime(recons.index))),
295295
dtype=r_dtype)
296296
df.index = np.array(
297297
list(map(Timestamp, df.index.to_datetime())),
@@ -316,7 +316,7 @@ def _to_uni(x):
316316
elif c_dtype == 'p':
317317
c_dtype = 'O'
318318
recons.columns = np.array(
319-
lmap(Timestamp, recons.columns.to_datetime()),
319+
lmap(Timestamp, to_datetime(recons.columns)),
320320
dtype=c_dtype)
321321
df.columns = np.array(
322322
lmap(Timestamp, df.columns.to_datetime()),
@@ -1157,3 +1157,9 @@ def test_to_csv_quoting(self):
11571157
df = df.set_index(['a', 'b'])
11581158
expected = '"a","b","c"\n"1","3","5"\n"2","4","6"\n'
11591159
self.assertEqual(df.to_csv(quoting=csv.QUOTE_ALL), expected)
1160+
1161+
1162+
if __name__ == '__main__':
1163+
import nose
1164+
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1165+
exit=False)

0 commit comments

Comments
 (0)