Skip to content

Commit 3ca4ab9

Browse files
committed
More regex fixes
1 parent 17584d3 commit 3ca4ab9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pandas/tests/test_algos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ def test_complex_sorting(self):
229229
# gh 12666 - check no segfault
230230
x17 = np.array([complex(i) for i in range(17)], dtype=object)
231231

232-
msg = (r"unorderable types: {0} [<>] {0}".format(r"complex\(\)")
232+
msg = ("no ordering relation is defined for complex numbers"
233233
if _np_version_under1p14 else
234-
r"'[<>]' not supported between instances of {0} and {0}".format(
234+
"'[<>]' not supported between instances of {0} and {0}".format(
235235
"'complex'")
236236
)
237237
with pytest.raises(TypeError, match=msg):

pandas/tests/test_sorting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,11 @@ def test_mixed_integer_from_list(self):
408408
def test_unsortable(self):
409409
# GH 13714
410410
arr = np.array([1, 2, datetime.now(), 0, 3], dtype=object)
411-
msg = (r"unorderable types: ({0} [<>] {1}|{1} [<>] {0})".format(
412-
r"int\(\)", r"datetime\.datetime\(\)") # noqa: E126
411+
msg = ("can't compare ({0} to {1}|{1} to {0})".format(
412+
"int", r"datetime\.datetime") # noqa: E126
413413
if _np_version_under1p14 else
414-
(r"'[<>]' not supported between instances of "
415-
r"({0} and {1}|{1} and {0})").format(
414+
("'[<>]' not supported between instances of "
415+
"({0} and {1}|{1} and {0})").format(
416416
"'int'", r"'datetime\.datetime'")
417417
)
418418
if compat.PY2:

0 commit comments

Comments
 (0)