@@ -86,10 +86,14 @@ def _test_arg_valid(self, ctor, arg):
8686 self .assertRaises (ValueError , ctor , arg ,
8787 quotechar = '\x85 ' , lineterminator = '\x85 ' )
8888
89+ # TODO: RUSTPYTHON
90+ @unittest .expectedFailure
8991 def test_reader_arg_valid (self ):
9092 self ._test_arg_valid (csv .reader , [])
9193 self .assertRaises (OSError , csv .reader , BadIterable ())
9294
95+ # TODO: RUSTPYTHON
96+ @unittest .expectedFailure
9397 def test_writer_arg_valid (self ):
9498 self ._test_arg_valid (csv .writer , StringIO ())
9599 class BadWriter :
@@ -210,6 +214,8 @@ def test_write_bigfield(self):
210214 self ._write_test ([bigstring ,bigstring ], '%s,%s' % \
211215 (bigstring , bigstring ))
212216
217+ # TODO: RUSTPYTHON
218+ @unittest .expectedFailure
213219 def test_write_quoting (self ):
214220 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' )
215221 self ._write_error_test (csv .Error , ['a' ,1 ,'p,q' ],
@@ -227,6 +233,8 @@ def test_write_quoting(self):
227233 self ._write_test (['a' ,'' ,None ,1 ], '"a","",,"1"' ,
228234 quoting = csv .QUOTE_NOTNULL )
229235
236+ # TODO: RUSTPYTHON
237+ @unittest .expectedFailure
230238 def test_write_escape (self ):
231239 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' ,
232240 escapechar = '\\ ' )
@@ -258,6 +266,8 @@ def test_write_escape(self):
258266 self ._write_test (['C\\ ' , '6' , '7' , 'X"' ], 'C\\ \\ ,6,7,"X"""' ,
259267 escapechar = '\\ ' , quoting = csv .QUOTE_MINIMAL )
260268
269+ # TODO: RUSTPYTHON
270+ @unittest .expectedFailure
261271 def test_write_lineterminator (self ):
262272 for lineterminator in '\r \n ' , '\n ' , '\r ' , '!@#' , '\0 ' :
263273 with self .subTest (lineterminator = lineterminator ):
@@ -271,6 +281,8 @@ def test_write_lineterminator(self):
271281 f'1,2{ lineterminator } '
272282 f'"\r ","\n "{ lineterminator } ' )
273283
284+ # TODO: RUSTPYTHON
285+ @unittest .expectedFailure
274286 def test_write_iterable (self ):
275287 self ._write_test (iter (['a' , 1 , 'p,q' ]), 'a,1,"p,q"' )
276288 self ._write_test (iter (['a' , 1 , None ]), 'a,1,' )
@@ -313,6 +325,8 @@ def test_writerows_with_none(self):
313325 self .assertEqual (fileobj .read (), 'a\r \n ""\r \n ' )
314326
315327
328+ # TODO: RUSTPYTHON
329+ @unittest .expectedFailure
316330 def test_write_empty_fields (self ):
317331 self ._write_test ((), '' )
318332 self ._write_test (['' ], '""' )
@@ -326,6 +340,8 @@ def test_write_empty_fields(self):
326340 self ._write_test (['' , '' ], ',' )
327341 self ._write_test ([None , None ], ',' )
328342
343+ # TODO: RUSTPYTHON
344+ @unittest .expectedFailure
329345 def test_write_empty_fields_space_delimiter (self ):
330346 self ._write_test (['' ], '""' , delimiter = ' ' , skipinitialspace = False )
331347 self ._write_test (['' ], '""' , delimiter = ' ' , skipinitialspace = True )
@@ -366,6 +382,8 @@ def _read_test(self, input, expect, **kwargs):
366382 result = list (reader )
367383 self .assertEqual (result , expect )
368384
385+ # TODO: RUSTPYTHON
386+ @unittest .expectedFailure
369387 def test_read_oddinputs (self ):
370388 self ._read_test ([], [])
371389 self ._read_test (['' ], [[]])
@@ -376,6 +394,8 @@ def test_read_oddinputs(self):
376394 self .assertRaises (csv .Error , self ._read_test ,
377395 [b'abc' ], None )
378396
397+ # TODO: RUSTPYTHON
398+ @unittest .expectedFailure
379399 def test_read_eol (self ):
380400 self ._read_test (['a,b' , 'c,d' ], [['a' ,'b' ], ['c' ,'d' ]])
381401 self ._read_test (['a,b\n ' , 'c,d\n ' ], [['a' ,'b' ], ['c' ,'d' ]])
@@ -390,6 +410,8 @@ def test_read_eol(self):
390410 with self .assertRaisesRegex (csv .Error , errmsg ):
391411 next (csv .reader (['a,b\r \n c,d' ]))
392412
413+ # TODO: RUSTPYTHON
414+ @unittest .expectedFailure
393415 def test_read_eof (self ):
394416 self ._read_test (['a,"' ], [['a' , '' ]])
395417 self ._read_test (['"a' ], [['a' ]])
@@ -399,6 +421,8 @@ def test_read_eof(self):
399421 self .assertRaises (csv .Error , self ._read_test ,
400422 ['^' ], [], escapechar = '^' , strict = True )
401423
424+ # TODO: RUSTPYTHON
425+ @unittest .expectedFailure
402426 def test_read_nul (self ):
403427 self ._read_test (['\0 ' ], [['\0 ' ]])
404428 self ._read_test (['a,\0 b,c' ], [['a' , '\0 b' , 'c' ]])
@@ -411,6 +435,8 @@ def test_read_delimiter(self):
411435 self ._read_test (['a;b;c' ], [['a' , 'b' , 'c' ]], delimiter = ';' )
412436 self ._read_test (['a\0 b\0 c' ], [['a' , 'b' , 'c' ]], delimiter = '\0 ' )
413437
438+ # TODO: RUSTPYTHON
439+ @unittest .expectedFailure
414440 def test_read_escape (self ):
415441 self ._read_test (['a,\\ b,c' ], [['a' , 'b' , 'c' ]], escapechar = '\\ ' )
416442 self ._read_test (['a,b\\ ,c' ], [['a' , 'b,c' ]], escapechar = '\\ ' )
@@ -423,6 +449,8 @@ def test_read_escape(self):
423449 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]], escapechar = None )
424450 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]])
425451
452+ # TODO: RUSTPYTHON
453+ @unittest .expectedFailure
426454 def test_read_quoting (self ):
427455 self ._read_test (['1,",3,",5' ], [['1' , ',3,' , '5' ]])
428456 self ._read_test (['1,",3,",5' ], [['1' , '"' , '3' , '"' , '5' ]],
@@ -459,6 +487,8 @@ def test_read_quoting(self):
459487 self ._read_test (['1\\ .5,\\ .5,"\\ .5"' ], [[1.5 , 0.5 , ".5" ]],
460488 quoting = csv .QUOTE_STRINGS , escapechar = '\\ ' )
461489
490+ # TODO: RUSTPYTHON; panic
491+ @unittest .skip ("TODO: RUSTPYTHON; slice index starts at 1 but ends at 0" )
462492 def test_read_skipinitialspace (self ):
463493 self ._read_test (['no space, space, spaces,\t tab' ],
464494 [['no space' , 'space' , 'spaces' , '\t tab' ]],
@@ -473,6 +503,8 @@ def test_read_skipinitialspace(self):
473503 [[None , None , None ]],
474504 skipinitialspace = True , quoting = csv .QUOTE_STRINGS )
475505
506+ # TODO: RUSTPYTHON
507+ @unittest .expectedFailure
476508 def test_read_space_delimiter (self ):
477509 self ._read_test (['a b' , ' a ' , ' ' , '' ],
478510 [['a' , '' , '' , 'b' ], ['' , '' , 'a' , '' , '' ], ['' , '' , '' ], []],
@@ -512,6 +544,8 @@ def test_read_linenum(self):
512544 self .assertRaises (StopIteration , next , r )
513545 self .assertEqual (r .line_num , 3 )
514546
547+ # TODO: RUSTPYTHON
548+ @unittest .expectedFailure
515549 def test_roundtrip_quoteed_newlines (self ):
516550 rows = [
517551 ['\n a' , 'b\n c' , 'd\n ' ],
@@ -530,6 +564,8 @@ def test_roundtrip_quoteed_newlines(self):
530564 for i , row in enumerate (csv .reader (fileobj )):
531565 self .assertEqual (row , rows [i ])
532566
567+ # TODO: RUSTPYTHON
568+ @unittest .expectedFailure
533569 def test_roundtrip_escaped_unquoted_newlines (self ):
534570 rows = [
535571 ['\n a' , 'b\n c' , 'd\n ' ],
@@ -644,6 +680,8 @@ def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
644680 fileobj .seek (0 )
645681 self .assertEqual (fileobj .read (), expected )
646682
683+ # TODO: RUSTPYTHON
684+ @unittest .expectedFailure
647685 def test_dialect_apply (self ):
648686 class testA (csv .excel ):
649687 delimiter = "\t "
@@ -679,6 +717,8 @@ def test_copy(self):
679717 dialect = csv .get_dialect (name )
680718 self .assertRaises (TypeError , copy .copy , dialect )
681719
720+ # TODO: RUSTPYTHON
721+ @unittest .expectedFailure
682722 def test_pickle (self ):
683723 for name in csv .list_dialects ():
684724 dialect = csv .get_dialect (name )
@@ -765,6 +805,8 @@ def test_quoted_quote(self):
765805 '"I see," said the blind man' ,
766806 'as he picked up his hammer and saw' ]])
767807
808+ # TODO: RUSTPYTHON
809+ @unittest .expectedFailure
768810 def test_quoted_nl (self ):
769811 input = '''\
770812 1,2,3,"""I see,""
@@ -805,15 +847,21 @@ class EscapedExcel(csv.excel):
805847class TestEscapedExcel (TestCsvBase ):
806848 dialect = EscapedExcel ()
807849
850+ # TODO: RUSTPYTHON
851+ @unittest .expectedFailure
808852 def test_escape_fieldsep (self ):
809853 self .writerAssertEqual ([['abc,def' ]], 'abc\\ ,def\r \n ' )
810854
855+ # TODO: RUSTPYTHON
856+ @unittest .expectedFailure
811857 def test_read_escape_fieldsep (self ):
812858 self .readerAssertEqual ('abc\\ ,def\r \n ' , [['abc,def' ]])
813859
814860class TestDialectUnix (TestCsvBase ):
815861 dialect = 'unix'
816862
863+ # TODO: RUSTPYTHON
864+ @unittest .expectedFailure
817865 def test_simple_writer (self ):
818866 self .writerAssertEqual ([[1 , 'abc def' , 'abc' ]], '"1","abc def","abc"\n ' )
819867
@@ -830,6 +878,8 @@ class TestQuotedEscapedExcel(TestCsvBase):
830878 def test_write_escape_fieldsep (self ):
831879 self .writerAssertEqual ([['abc,def' ]], '"abc,def"\r \n ' )
832880
881+ # TODO: RUSTPYTHON
882+ @unittest .expectedFailure
833883 def test_read_escape_fieldsep (self ):
834884 self .readerAssertEqual ('"abc\\ ,def"\r \n ' , [['abc,def' ]])
835885
@@ -1026,6 +1076,8 @@ def test_read_multi(self):
10261076 "s1" : 'abc' ,
10271077 "s2" : 'def' })
10281078
1079+ # TODO: RUSTPYTHON
1080+ @unittest .expectedFailure
10291081 def test_read_with_blanks (self ):
10301082 reader = csv .DictReader (["1,2,abc,4,5,6\r \n " ,"\r \n " ,
10311083 "1,2,abc,4,5,6\r \n " ],
@@ -1077,6 +1129,8 @@ def test_float_write(self):
10771129 fileobj .seek (0 )
10781130 self .assertEqual (fileobj .read (), expected )
10791131
1132+ # TODO: RUSTPYTHON
1133+ @unittest .expectedFailure
10801134 def test_char_write (self ):
10811135 import array , string
10821136 a = array .array ('w' , string .ascii_letters )
@@ -1224,6 +1278,8 @@ class mydialect(csv.Dialect):
12241278 self .assertEqual (str (cm .exception ),
12251279 '"lineterminator" must be a string' )
12261280
1281+ # TODO: RUSTPYTHON
1282+ @unittest .expectedFailure
12271283 def test_invalid_chars (self ):
12281284 def create_invalid (field_name , value , ** kwargs ):
12291285 class mydialect (csv .Dialect ):
0 commit comments