TST: skip testing on windows for specific formatting which sometimes hangs (#14851)

xref #14626
(cherry picked from commit 34807fc25e)
This commit is contained in:
Jeff Reback 2016-12-10 10:31:53 -05:00 committed by Joris Van den Bossche
parent bcd76ed94d
commit 3276c8aeb2
1 changed files with 4 additions and 15 deletions

View File

@ -914,23 +914,12 @@ class TestIndex(Base, tm.TestCase):
self._check_method_works(Index.format)
# GH 14626
# our formatting is different by definition when we have
# ms vs us precision (e.g. trailing zeros);
# so don't compare this case
def datetime_now_without_trailing_zeros():
now = datetime.now()
while str(now).endswith("000"):
now = datetime.now()
return now
index = Index([datetime_now_without_trailing_zeros()])
# windows has different precision on datetime.datetime.now (it doesn't
# include us since the default for Timestamp shows these but Index
# formating does not we are skipping
if not is_platform_windows():
# formating does not we are skipping)
now = datetime.now()
if not str(now).endswith("000"):
index = Index([now])
formatted = index.format()
expected = [str(index[0])]
self.assertEqual(formatted, expected)