Skip to content

Commit 3276c8a

Browse files
jrebackjorisvandenbossche
authored andcommitted
TST: skip testing on windows for specific formatting which sometimes hangs (#14851)
xref #14626 (cherry picked from commit 34807fc)
1 parent bcd76ed commit 3276c8a

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

pandas/tests/indexes/test_base.py

+4-15
Original file line numberDiff line numberDiff line change
@@ -914,23 +914,12 @@ def test_format(self):
914914
self._check_method_works(Index.format)
915915

916916
# GH 14626
917-
# our formatting is different by definition when we have
918-
# ms vs us precision (e.g. trailing zeros);
919-
# so don't compare this case
920-
def datetime_now_without_trailing_zeros():
921-
now = datetime.now()
922-
923-
while str(now).endswith("000"):
924-
now = datetime.now()
925-
926-
return now
927-
928-
index = Index([datetime_now_without_trailing_zeros()])
929-
930917
# windows has different precision on datetime.datetime.now (it doesn't
931918
# include us since the default for Timestamp shows these but Index
932-
# formating does not we are skipping
933-
if not is_platform_windows():
919+
# formating does not we are skipping)
920+
now = datetime.now()
921+
if not str(now).endswith("000"):
922+
index = Index([now])
934923
formatted = index.format()
935924
expected = [str(index[0])]
936925
self.assertEqual(formatted, expected)

0 commit comments

Comments
 (0)