| 59 | ids=["tolist", "to_list", "list", "iter"], |
| 60 | ) |
| 61 | def test_iterable(self, index_or_series, method, dtype, rdtype): |
| 62 | # gh-10904 |
| 63 | # gh-13258 |
| 64 | # coerce iteration to underlying python / pandas types |
| 65 | typ = index_or_series |
| 66 | if dtype == "float16" and issubclass(typ, pd.Index): |
| 67 | with pytest.raises(NotImplementedError, match="float16 indexes are not "): |
| 68 | typ([1], dtype=dtype) |
| 69 | return |
| 70 | s = typ([1], dtype=dtype) |
| 71 | result = method(s)[0] |
| 72 | assert isinstance(result, rdtype) |
| 73 | |
| 74 | @pytest.mark.parametrize( |
| 75 | "dtype, rdtype, obj", |