MCPcopy
hub / github.com/pandas-dev/pandas / test_iterable

Method test_iterable

pandas/tests/base/test_conversion.py:61–72  ·  view source on GitHub ↗
(self, index_or_series, method, dtype, rdtype)

Source from the content-addressed store, hash-verified

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",

Callers

nothing calls this directly

Calls 2

methodFunction · 0.50
raisesMethod · 0.45

Tested by

no test coverage detected