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

xref #14626
This commit is contained in:
Jeff Reback 2016-12-10 10:31:53 -05:00 committed by GitHub
parent 000e8d4f2f
commit 34807fc25e
1 changed files with 4 additions and 15 deletions

View File

@ -915,23 +915,12 @@ class TestIndex(Base, tm.TestCase):
# 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)