From 4cde57ede3544a333be1d4139df1668734a71c69 Mon Sep 17 00:00:00 2001 From: Shilpa Sugan Karthikeyan Date: Mon, 2 Mar 2020 17:10:28 +0000 Subject: [PATCH 1/2] fixed boolean test --- pandas/tests/arrays/test_boolean.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arrays/test_boolean.py b/pandas/tests/arrays/test_boolean.py index d14d6f3ff0c41..e8686b871f713 100644 --- a/pandas/tests/arrays/test_boolean.py +++ b/pandas/tests/arrays/test_boolean.py @@ -248,7 +248,11 @@ def test_coerce_to_numpy_array(): tm.assert_numpy_array_equal(result, expected) # with missing values will raise error arr = pd.array([True, False, None], dtype="boolean") - with pytest.raises(ValueError): + msg = str( + "cannot convert to 'bool'-dtype NumPy array with missing values." + + " Specify an appropriate 'na_value' for this dtype." + ) + with pytest.raises(ValueError, match=msg): np.array(arr, dtype="bool") From 27798410d957aef5842a371acb3a8e9d1d18b4e3 Mon Sep 17 00:00:00 2001 From: Shilpa Sugan Karthikeyan Date: Tue, 3 Mar 2020 11:55:34 +0000 Subject: [PATCH 2/2] fixed error msg --- pandas/tests/arrays/test_boolean.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/arrays/test_boolean.py b/pandas/tests/arrays/test_boolean.py index e8686b871f713..f4b466f4804c7 100644 --- a/pandas/tests/arrays/test_boolean.py +++ b/pandas/tests/arrays/test_boolean.py @@ -248,9 +248,9 @@ def test_coerce_to_numpy_array(): tm.assert_numpy_array_equal(result, expected) # with missing values will raise error arr = pd.array([True, False, None], dtype="boolean") - msg = str( - "cannot convert to 'bool'-dtype NumPy array with missing values." - + " Specify an appropriate 'na_value' for this dtype." + msg = ( + "cannot convert to 'bool'-dtype NumPy array with missing values. " + "Specify an appropriate 'na_value' for this dtype." ) with pytest.raises(ValueError, match=msg): np.array(arr, dtype="bool")