From 8e7709f6d3d00b2fe9e7752d233a0c6f1d517b7b Mon Sep 17 00:00:00 2001 From: gdex <40249442+gdex1@users.noreply.github.com> Date: Wed, 15 Jan 2020 10:34:02 -0500 Subject: [PATCH 1/2] TST: Add pytest.raises match arg to test_objarr_radd_str_invalid --- pandas/tests/arithmetic/test_object.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arithmetic/test_object.py b/pandas/tests/arithmetic/test_object.py index 799ef3492e53f..085506da48c9f 100644 --- a/pandas/tests/arithmetic/test_object.py +++ b/pandas/tests/arithmetic/test_object.py @@ -137,7 +137,12 @@ def test_objarr_radd_str_invalid(self, dtype, data, box_with_array): ser = Series(data, dtype=dtype) ser = tm.box_expected(ser, box_with_array) - with pytest.raises(TypeError): + msg = ( + "can only concatenate str|" + "did not contain a loop with signature matching types|" + "unsupported operand type" + ) + with pytest.raises(TypeError, match=msg): "foo_" + ser @pytest.mark.parametrize("op", [operator.add, ops.radd, operator.sub, ops.rsub]) From d58f644b6c8c145950df7aeebe815f5d8f0c74d5 Mon Sep 17 00:00:00 2001 From: gdex <40249442+gdex1@users.noreply.github.com> Date: Wed, 15 Jan 2020 11:54:23 -0500 Subject: [PATCH 2/2] Added message match based on online integration test for test_objarr_radd_str_invalid --- pandas/tests/arithmetic/test_object.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arithmetic/test_object.py b/pandas/tests/arithmetic/test_object.py index 085506da48c9f..c0d3c9d4977bd 100644 --- a/pandas/tests/arithmetic/test_object.py +++ b/pandas/tests/arithmetic/test_object.py @@ -140,7 +140,8 @@ def test_objarr_radd_str_invalid(self, dtype, data, box_with_array): msg = ( "can only concatenate str|" "did not contain a loop with signature matching types|" - "unsupported operand type" + "unsupported operand type|" + "must be str" ) with pytest.raises(TypeError, match=msg): "foo_" + ser