@@ -108,14 +108,11 @@ def test_none_to_nan(cls, dtype):
108108def test_setitem_validates (cls , dtype ):
109109 arr = cls ._from_sequence (["a" , "b" ], dtype = dtype )
110110
111- if dtype .storage == "python" :
112- msg = "Cannot set non-string value '10' into a StringArray."
113- else :
114- msg = "Scalar must be NA or str"
111+ msg = "Invalid value '10' for dtype 'str"
115112 with pytest .raises (TypeError , match = msg ):
116113 arr [0 ] = 10
117114
118- msg = "Must provide strings "
115+ msg = "Invalid value for dtype 'str "
119116 with pytest .raises (TypeError , match = msg ):
120117 arr [:] = np .array ([1 , 2 ])
121118
@@ -510,10 +507,7 @@ def test_fillna_args(dtype):
510507 expected = pd .array (["a" , "b" ], dtype = dtype )
511508 tm .assert_extension_array_equal (res , expected )
512509
513- if dtype .storage == "pyarrow" :
514- msg = "Invalid value '1' for dtype str"
515- else :
516- msg = "Cannot set non-string value '1' into a StringArray."
510+ msg = "Invalid value '1' for dtype 'str"
517511 with pytest .raises (TypeError , match = msg ):
518512 arr .fillna (value = 1 )
519513
@@ -754,10 +748,7 @@ def test_setitem_scalar_with_mask_validation(dtype):
754748
755749 # for other non-string we should also raise an error
756750 ser = pd .Series (["a" , "b" , "c" ], dtype = dtype )
757- if dtype .storage == "python" :
758- msg = "Cannot set non-string value"
759- else :
760- msg = "Scalar must be NA or str"
751+ msg = "Invalid value '1' for dtype 'str"
761752 with pytest .raises (TypeError , match = msg ):
762753 ser [mask ] = 1
763754
0 commit comments