|
7 | 7 | import pytest
|
8 | 8 |
|
9 | 9 | from pandas import (
|
10 |
| - DataFrame, MultiIndex, Series, compat, concat, merge, to_datetime) |
| 10 | + DataFrame, MultiIndex, Series, _np_version_under1p14, compat, concat, |
| 11 | + merge, to_datetime) |
11 | 12 | from pandas.core import common as com
|
12 | 13 | from pandas.core.sorting import (
|
13 | 14 | decons_group_index, get_group_index, is_int64_overflow_possible,
|
@@ -413,10 +414,13 @@ def test_mixed_integer_from_list(self):
|
413 | 414 | def test_unsortable(self):
|
414 | 415 | # GH 13714
|
415 | 416 | arr = np.array([1, 2, datetime.now(), 0, 3], dtype=object)
|
416 |
| - msg = (r"'(<|>)' not supported between instances of ('" |
417 |
| - r"datetime\.datetime' and 'int'|'int' and 'datetime\.datetime" |
418 |
| - r"')|" |
419 |
| - r"unorderable types: int\(\) > datetime\.datetime\(\)") |
| 417 | + msg = (r"unorderable types: ({0} [<>] {1}|{1} [<>] {0})".format( |
| 418 | + r"int\(\)", r"datetime\.datetime\(\)") # noqa: E126 |
| 419 | + if _np_version_under1p14 else |
| 420 | + (r"'[<>]' not supported between instances of " |
| 421 | + r"({0} and {1}|{1} and {0})").format( |
| 422 | + "'int'", r"'datetime\.datetime'") |
| 423 | + ) |
420 | 424 | with pytest.raises(TypeError, match=msg):
|
421 | 425 | safe_sort(arr)
|
422 | 426 |
|
|
0 commit comments