|
7 | 7 | from numpy import nan
|
8 | 8 | import pytest
|
9 | 9 |
|
10 |
| -from pandas.compat import PY2 |
| 10 | +from pandas.compat.numpy import _np_version_under1p14 |
11 | 11 |
|
12 | 12 | from pandas import DataFrame, MultiIndex, Series, compat, concat, merge
|
13 | 13 | from pandas.core import common as com
|
@@ -405,15 +405,16 @@ def test_mixed_integer_from_list(self):
|
405 | 405 | expected = np.array([0, 0, 1, 'a', 'b', 'b'], dtype=object)
|
406 | 406 | tm.assert_numpy_array_equal(result, expected)
|
407 | 407 |
|
408 |
| - @pytest.mark.skipif(PY2, reason="pytest.raises match regex fails") |
409 | 408 | def test_unsortable(self):
|
410 | 409 | # GH 13714
|
411 | 410 | arr = np.array([1, 2, datetime.now(), 0, 3], dtype=object)
|
412 |
| - msg = (r"'(<|>)' not supported between instances of ('" |
413 |
| - r"datetime\.datetime' and 'int'|'int' and 'datetime\.datetime" |
414 |
| - r"')|" |
415 |
| - r"unorderable types: int\(\) < datetime\.datetime\(\)|" |
416 |
| - r"unorderable types: datetime\.datetime\(\) < int\(\)") |
| 411 | + msg = (r"unorderable types: ({0} [<>] {1}|{1} [<>] {0})".format( |
| 412 | + r"int\(\)", r"datetime\.datetime\(\)") # noqa: E126 |
| 413 | + if _np_version_under1p14 else |
| 414 | + (r"'[<>]' not supported between instances of " |
| 415 | + r"({0} and {1}|{1} and {0})").format( |
| 416 | + "'int'", r"'datetime\.datetime'") |
| 417 | + ) |
417 | 418 | if compat.PY2:
|
418 | 419 | # RuntimeWarning: tp_compare didn't return -1 or -2 for exception
|
419 | 420 | with warnings.catch_warnings():
|
|
0 commit comments