Skip to content

Commit e34e4be

Browse files
committed
TST: skip a datetime formatting issue on windows as datetime.datetime does
not have the same precision on all platforms
1 parent dc815bc commit e34e4be

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pandas/tests/test_index.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from pandas.util.testing import (assert_almost_equal, assertRaisesRegexp,
2020
assert_copy)
2121
from pandas import compat
22-
from pandas.compat import long
22+
from pandas.compat import long, is_platform_windows
2323

2424
import pandas.util.testing as tm
2525
import pandas.core.config as cf
@@ -1000,9 +1000,15 @@ def test_format(self):
10001000
self._check_method_works(Index.format)
10011001

10021002
index = Index([datetime.now()])
1003-
formatted = index.format()
1004-
expected = [str(index[0])]
1005-
self.assertEqual(formatted, expected)
1003+
1004+
1005+
# windows has different precision on datetime.datetime.now (it doesn't include us
1006+
# since the default for Timestamp shows these but Index formating does not
1007+
# we are skipping
1008+
if not is_platform_windows:
1009+
formatted = index.format()
1010+
expected = [str(index[0])]
1011+
self.assertEqual(formatted, expected)
10061012

10071013
# 2845
10081014
index = Index([1, 2.0+3.0j, np.nan])

0 commit comments

Comments
 (0)