@@ -108,14 +108,11 @@ def test_none_to_nan(cls, dtype):
108
108
def test_setitem_validates (cls , dtype ):
109
109
arr = cls ._from_sequence (["a" , "b" ], dtype = dtype )
110
110
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"
115
112
with pytest .raises (TypeError , match = msg ):
116
113
arr [0 ] = 10
117
114
118
- msg = "Must provide strings "
115
+ msg = "Invalid value for dtype 'str "
119
116
with pytest .raises (TypeError , match = msg ):
120
117
arr [:] = np .array ([1 , 2 ])
121
118
@@ -510,10 +507,7 @@ def test_fillna_args(dtype):
510
507
expected = pd .array (["a" , "b" ], dtype = dtype )
511
508
tm .assert_extension_array_equal (res , expected )
512
509
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"
517
511
with pytest .raises (TypeError , match = msg ):
518
512
arr .fillna (value = 1 )
519
513
@@ -754,10 +748,7 @@ def test_setitem_scalar_with_mask_validation(dtype):
754
748
755
749
# for other non-string we should also raise an error
756
750
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"
761
752
with pytest .raises (TypeError , match = msg ):
762
753
ser [mask ] = 1
763
754
0 commit comments