Skip to content

Commit d7bd4f5

Browse files
committed
TST: skip testing on windows for specific formatting which sometimes hangs
xref #14626
1 parent 000e8d4 commit d7bd4f5

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
@@ -915,23 +915,12 @@ def test_format(self):
915915
self._check_method_works(Index.format)
916916

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

0 commit comments

Comments
 (0)