From fa6f62b6625171f60143ecda14d2dbf66dd9b3fb Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Fri, 17 Jan 2020 09:52:38 +0200 Subject: [PATCH] CLN: Regular expression clean as @jbrockmendel suggested Ref: https://github.com/pandas-dev/pandas/pull/31091#discussion_r367732954 --- pandas/tests/arrays/categorical/test_algos.py | 2 +- pandas/tests/indexes/multi/test_analytics.py | 2 +- pandas/tests/indexes/period/test_indexing.py | 2 +- pandas/tests/series/indexing/test_indexing.py | 2 +- pandas/tests/test_take.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/tests/arrays/categorical/test_algos.py b/pandas/tests/arrays/categorical/test_algos.py index 07abdceb71f9f..5ff0bb8ef0d78 100644 --- a/pandas/tests/arrays/categorical/test_algos.py +++ b/pandas/tests/arrays/categorical/test_algos.py @@ -111,7 +111,7 @@ def test_take_bounds(self, allow_fill): if allow_fill: msg = "indices are out-of-bounds" else: - msg = "index 4 is out of bounds for( axis 0 with|) size 3" + msg = "index 4 is out of bounds for( axis 0 with)? size 3" with pytest.raises(IndexError, match=msg): cat.take([4, 5], allow_fill=allow_fill) diff --git a/pandas/tests/indexes/multi/test_analytics.py b/pandas/tests/indexes/multi/test_analytics.py index 5d441b0fa8091..2db61d4f4b852 100644 --- a/pandas/tests/indexes/multi/test_analytics.py +++ b/pandas/tests/indexes/multi/test_analytics.py @@ -218,7 +218,7 @@ def test_take_fill_value(): with pytest.raises(ValueError, match=msg): idx.take(np.array([1, 0, -5]), fill_value=True) - msg = "index -5 is out of bounds for( axis 0 with|) size 4" + msg = "index -5 is out of bounds for( axis 0 with)? size 4" with pytest.raises(IndexError, match=msg): idx.take(np.array([1, -5])) diff --git a/pandas/tests/indexes/period/test_indexing.py b/pandas/tests/indexes/period/test_indexing.py index 900b1cc91d905..1e3160980e8bb 100644 --- a/pandas/tests/indexes/period/test_indexing.py +++ b/pandas/tests/indexes/period/test_indexing.py @@ -357,7 +357,7 @@ def test_take_fill_value(self): with pytest.raises(ValueError, match=msg): idx.take(np.array([1, 0, -5]), fill_value=True) - msg = "index -5 is out of bounds for( axis 0 with|) size 3" + msg = "index -5 is out of bounds for( axis 0 with)? size 3" with pytest.raises(IndexError, match=msg): idx.take(np.array([1, -5])) diff --git a/pandas/tests/series/indexing/test_indexing.py b/pandas/tests/series/indexing/test_indexing.py index 4bc5bb90f2cb7..65731cf45bd2d 100644 --- a/pandas/tests/series/indexing/test_indexing.py +++ b/pandas/tests/series/indexing/test_indexing.py @@ -894,7 +894,7 @@ def test_take(): expected = Series([4, 2, 4], index=[4, 3, 4]) tm.assert_series_equal(actual, expected) - msg = "index {} is out of bounds for( axis 0 with|) size 5" + msg = "index {} is out of bounds for( axis 0 with)? size 5" with pytest.raises(IndexError, match=msg.format(10)): s.take([1, 10]) with pytest.raises(IndexError, match=msg.format(5)): diff --git a/pandas/tests/test_take.py b/pandas/tests/test_take.py index d7c6496e0ae5b..1d2ab9358c01c 100644 --- a/pandas/tests/test_take.py +++ b/pandas/tests/test_take.py @@ -428,7 +428,7 @@ def test_bounds_check_large(self): with pytest.raises(IndexError, match=msg): algos.take(arr, [2, 3], allow_fill=True) - msg = "index 2 is out of bounds for( axis 0 with|) size 2" + msg = "index 2 is out of bounds for( axis 0 with)? size 2" with pytest.raises(IndexError, match=msg): algos.take(arr, [2, 3], allow_fill=False)