@@ -61,10 +61,7 @@ def _check_expected_dtype(self, obj, label):
6161 considering not-supported dtypes
6262 """
6363 if isinstance (obj , Index ):
64- if label == "bool" :
65- assert obj .dtype == "object"
66- else :
67- assert obj .dtype == label
64+ assert obj .dtype == label
6865 elif isinstance (obj , Series ):
6966 if label .startswith ("period" ):
7067 assert obj .dtype == "Period[M]"
@@ -185,7 +182,7 @@ def test_concatlike_same_dtypes(self, item):
185182 with pytest .raises (TypeError , match = msg ):
186183 pd .concat ([Series (vals1 ), Series (vals2 ), vals3 ])
187184
188- def test_concatlike_dtypes_coercion (self , item , item2 ):
185+ def test_concatlike_dtypes_coercion (self , item , item2 , request ):
189186 # GH 13660
190187 typ1 , vals1 = item
191188 typ2 , vals2 = item2
@@ -209,8 +206,12 @@ def test_concatlike_dtypes_coercion(self, item, item2):
209206 # series coerces to numeric based on numpy rule
210207 # index doesn't because bool is object dtype
211208 exp_series_dtype = typ2
209+ mark = pytest .mark .xfail (reason = "GH#39187 casting to object" )
210+ request .node .add_marker (mark )
212211 elif typ2 == "bool" and typ1 in ("int64" , "float64" ):
213212 exp_series_dtype = typ1
213+ mark = pytest .mark .xfail (reason = "GH#39187 casting to object" )
214+ request .node .add_marker (mark )
214215 elif (
215216 typ1 == "datetime64[ns, US/Eastern]"
216217 or typ2 == "datetime64[ns, US/Eastern]"
0 commit comments