@@ -221,28 +221,28 @@ def test_setitem_integer_array_with_repeats(self, data, idx, box_in_series):
221221 tm .assert_equal (arr , expected )
222222
223223 @pytest .mark .parametrize (
224- "idx, box_in_series " ,
224+ "idx" ,
225225 [
226- ([0 , 1 , 2 , pd .NA ], False ),
227- pytest .param (
228- [0 , 1 , 2 , pd .NA ], True , marks = pytest .mark .xfail (reason = "GH-31948" )
229- ),
230- (pd .array ([0 , 1 , 2 , pd .NA ], dtype = "Int64" ), False ),
231- # TODO: change False to True?
232- (pd .array ([0 , 1 , 2 , pd .NA ], dtype = "Int64" ), False ), # noqa: PT014
226+ [0 , 1 , 2 , pd .NA ],
227+ pd .array ([0 , 1 , 2 , pd .NA ], dtype = "Int64" ),
233228 ],
234- ids = ["list-False " , "list-True" , " integer-array-False" , "integer-array-True " ],
229+ ids = ["list" , "integer-array" ],
235230 )
231+ @pytest .mark .parametrize ("box_in_series" , [True , False ])
236232 def test_setitem_integer_with_missing_raises (self , data , idx , box_in_series ):
237233 arr = data .copy ()
238234
239- # TODO(xfail) this raises KeyError about labels not found (it tries label-based)
240- # for list of labels with Series
235+ msg = "Cannot index with an integer indexer containing NA values"
236+ err = ValueError
237+
241238 if box_in_series :
239+ # The integer labels are not present in the (string) index, so
240+ # we get KeyErrors
242241 arr = pd .Series (data , index = [chr (100 + i ) for i in range (len (data ))])
242+ msg = "0"
243+ err = KeyError
243244
244- msg = "Cannot index with an integer indexer containing NA values"
245- with pytest .raises (ValueError , match = msg ):
245+ with pytest .raises (err , match = msg ):
246246 arr [idx ] = arr [0 ]
247247
248248 @pytest .mark .parametrize ("as_callable" , [True , False ])
0 commit comments