1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
U
­ý°dý
ã@sŽdZddlmZddlZddlmZmZddlmZ    ej
  d¡Z dd„Z dd    „Zd
d „Zej
 d d ddœdd iddig¡dd„ƒZdd„ZdS)zy
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
é)ÚStringION)Ú    DataFrameÚconcatZ pyarrow_skipc    Csˆd}|}ddi}|jt|ƒf|Ž}|jt|ƒfddi|—Ž.}| d¡}t ||dd…¡| d¡}W5QRXt ||dd…¡dS)Nziindex,A,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo2,12,13,14,15
bar2,12,13,14,15
Z    index_colrÚiteratorTéé)Úread_csvrÚreadÚtmÚassert_frame_equal)Ú all_parsersÚdataÚparserÚkwargsÚexpectedÚreaderZ first_chunkÚ
last_chunk©rúbd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/io/parser/common/test_iterator.pyÚ test_iterators
rc    Cst|}d}|jt|ƒdd}t|ƒ}W5QRXtdddgddd    gd
d d ggd ddgdddgd}t |d|¡dS)Nú$A,B,C
foo,1,2,3
bar,4,5,6
baz,7,8,9
T)rééréréééé    ÚfooÚbarÚbazÚAÚBÚC©ÚindexÚcolumnsr)rrÚlistrr
r ©r rr rÚresultrrrrÚtest_iterator2(sýr*c    Cs„|}d}|jt|ƒdd}t|ƒ}W5QRXt|ƒdks>t‚tdddgdddgd    d
d ggd d dgdddgd}t t|ƒ|¡dS)Nrr)Ú    chunksizerrrrrrrrrrr r!r"r#r$)    rrr'ÚlenÚAssertionErrorrr
r rr(rrrÚtest_iterator_stop_on_chunksize;sýr.rTr)rr+rr+c
CsPd}|}d}tjt|d,|jt|ƒfddi|—Ž}W5QRXW5QRXdS)Nz('skipfooter' not supported for iterationza
1
2)ÚmatchZ
skipfooterr)ÚpytestZraisesÚ
ValueErrorrr)r rÚmsgrr Ú_rrrÚtest_iterator_skipfooter_errorsPs r4c
Csœ|}ddi}t ¡~}t|dƒ}| d¡W5QRXt|ƒJ}|D]}d|krDqVqD|j|f|Ž}tddddd    giƒ}t ||¡W5QRXW5QRXdS)
NÚheaderÚwzAAA
BBB
CCC
DDD
EEE
FFF
GGGZCCCrZDDDZEEEZFFFZGGG)r
Z ensure_cleanÚopenÚwriterrr )r rrÚpathÚfÚliner)rrrrÚtest_iteration_open_handle]s
 
r<)Ú__doc__Úiorr0ZpandasrrZpandas._testingZ_testingr
ÚmarkZ usefixturesZ
pytestmarkrr*r.Z parametrizer4r<rrrrÚ<module>s   ÿ