From 172d81c674755bd1cf532b93dc8190d51bca700e Mon Sep 17 00:00:00 2001 From: Amy Graham Date: Wed, 19 Feb 2020 12:27:01 +0000 Subject: [PATCH 1/2] added msg to TypeError test_to_boolean_array_error --- pandas/tests/arrays/test_boolean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/arrays/test_boolean.py b/pandas/tests/arrays/test_boolean.py index cb9b07db4a0df..0fed959031c8b 100644 --- a/pandas/tests/arrays/test_boolean.py +++ b/pandas/tests/arrays/test_boolean.py @@ -130,8 +130,8 @@ def test_to_boolean_array_missing_indicators(a, b): ], ) def test_to_boolean_array_error(values): - # error in converting existing arrays to BooleanArray - with pytest.raises(TypeError): + msg = "Error converting existing arrays to BooleanArray" + with pytest.raises(TypeError, match=msg): pd.array(values, dtype="boolean") From 96eead44b9f4424413e381c4f8b52f670c69e2df Mon Sep 17 00:00:00 2001 From: Amy Graham Date: Thu, 20 Feb 2020 13:42:53 +0000 Subject: [PATCH 2/2] updated message to reflect error raised --- pandas/tests/arrays/test_boolean.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arrays/test_boolean.py b/pandas/tests/arrays/test_boolean.py index 0fed959031c8b..d14d6f3ff0c41 100644 --- a/pandas/tests/arrays/test_boolean.py +++ b/pandas/tests/arrays/test_boolean.py @@ -130,7 +130,8 @@ def test_to_boolean_array_missing_indicators(a, b): ], ) def test_to_boolean_array_error(values): - msg = "Error converting existing arrays to BooleanArray" + # error in converting existing arrays to BooleanArray + msg = "Need to pass bool-like value" with pytest.raises(TypeError, match=msg): pd.array(values, dtype="boolean")