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

Method test_iterator

pandas/tests/io/test_common.py:162–172  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 assert not s.closed
161
162 def test_iterator(self):
163 with pd.read_csv(StringIO(self.data1), chunksize=1) as reader:
164 result = pd.concat(reader, ignore_index=True)
165 expected = pd.read_csv(StringIO(self.data1))
166 tm.assert_frame_equal(result, expected)
167
168 # GH12153
169 with pd.read_csv(StringIO(self.data1), chunksize=1) as it:
170 first = next(it)
171 tm.assert_frame_equal(first, expected.iloc[[0]])
172 tm.assert_frame_equal(pd.concat(it), expected.iloc[1:])
173
174 @pytest.mark.skipif(WASM, reason="limited file system access on WASM")
175 @pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

concatMethod · 0.80
read_csvMethod · 0.45

Tested by

no test coverage detected