@@ -86,14 +86,12 @@ 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
89+ @unittest .expectedFailure # TODO: RUSTPYTHON
9190 def test_reader_arg_valid (self ):
9291 self ._test_arg_valid (csv .reader , [])
9392 self .assertRaises (OSError , csv .reader , BadIterable ())
9493
95- # TODO: RUSTPYTHON
96- @unittest .expectedFailure
94+ @unittest .expectedFailure # TODO: RUSTPYTHON
9795 def test_writer_arg_valid (self ):
9896 self ._test_arg_valid (csv .writer , StringIO ())
9997 class BadWriter :
@@ -214,8 +212,7 @@ def test_write_bigfield(self):
214212 self ._write_test ([bigstring ,bigstring ], '%s,%s' % \
215213 (bigstring , bigstring ))
216214
217- # TODO: RUSTPYTHON
218- @unittest .expectedFailure
215+ @unittest .expectedFailure # TODO: RUSTPYTHON
219216 def test_write_quoting (self ):
220217 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' )
221218 self ._write_error_test (csv .Error , ['a' ,1 ,'p,q' ],
@@ -233,8 +230,7 @@ def test_write_quoting(self):
233230 self ._write_test (['a' ,'' ,None ,1 ], '"a","",,"1"' ,
234231 quoting = csv .QUOTE_NOTNULL )
235232
236- # TODO: RUSTPYTHON
237- @unittest .expectedFailure
233+ @unittest .expectedFailure # TODO: RUSTPYTHON
238234 def test_write_escape (self ):
239235 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' ,
240236 escapechar = '\\ ' )
@@ -266,8 +262,7 @@ def test_write_escape(self):
266262 self ._write_test (['C\\ ' , '6' , '7' , 'X"' ], 'C\\ \\ ,6,7,"X"""' ,
267263 escapechar = '\\ ' , quoting = csv .QUOTE_MINIMAL )
268264
269- # TODO: RUSTPYTHON
270- @unittest .expectedFailure
265+ @unittest .expectedFailure # TODO: RUSTPYTHON
271266 def test_write_lineterminator (self ):
272267 for lineterminator in '\r \n ' , '\n ' , '\r ' , '!@#' , '\0 ' :
273268 with self .subTest (lineterminator = lineterminator ):
@@ -281,8 +276,7 @@ def test_write_lineterminator(self):
281276 f'1,2{ lineterminator } '
282277 f'"\r ","\n "{ lineterminator } ' )
283278
284- # TODO: RUSTPYTHON
285- @unittest .expectedFailure
279+ @unittest .expectedFailure # TODO: RUSTPYTHON
286280 def test_write_iterable (self ):
287281 self ._write_test (iter (['a' , 1 , 'p,q' ]), 'a,1,"p,q"' )
288282 self ._write_test (iter (['a' , 1 , None ]), 'a,1,' )
@@ -325,8 +319,7 @@ def test_writerows_with_none(self):
325319 self .assertEqual (fileobj .read (), 'a\r \n ""\r \n ' )
326320
327321
328- # TODO: RUSTPYTHON
329- @unittest .expectedFailure
322+ @unittest .expectedFailure # TODO: RUSTPYTHON
330323 def test_write_empty_fields (self ):
331324 self ._write_test ((), '' )
332325 self ._write_test (['' ], '""' )
@@ -340,8 +333,7 @@ def test_write_empty_fields(self):
340333 self ._write_test (['' , '' ], ',' )
341334 self ._write_test ([None , None ], ',' )
342335
343- # TODO: RUSTPYTHON
344- @unittest .expectedFailure
336+ @unittest .expectedFailure # TODO: RUSTPYTHON
345337 def test_write_empty_fields_space_delimiter (self ):
346338 self ._write_test (['' ], '""' , delimiter = ' ' , skipinitialspace = False )
347339 self ._write_test (['' ], '""' , delimiter = ' ' , skipinitialspace = True )
@@ -382,8 +374,7 @@ def _read_test(self, input, expect, **kwargs):
382374 result = list (reader )
383375 self .assertEqual (result , expect )
384376
385- # TODO: RUSTPYTHON
386- @unittest .expectedFailure
377+ @unittest .expectedFailure # TODO: RUSTPYTHON
387378 def test_read_oddinputs (self ):
388379 self ._read_test ([], [])
389380 self ._read_test (['' ], [[]])
@@ -394,8 +385,7 @@ def test_read_oddinputs(self):
394385 self .assertRaises (csv .Error , self ._read_test ,
395386 [b'abc' ], None )
396387
397- # TODO: RUSTPYTHON
398- @unittest .expectedFailure
388+ @unittest .expectedFailure # TODO: RUSTPYTHON
399389 def test_read_eol (self ):
400390 self ._read_test (['a,b' , 'c,d' ], [['a' ,'b' ], ['c' ,'d' ]])
401391 self ._read_test (['a,b\n ' , 'c,d\n ' ], [['a' ,'b' ], ['c' ,'d' ]])
@@ -410,8 +400,7 @@ def test_read_eol(self):
410400 with self .assertRaisesRegex (csv .Error , errmsg ):
411401 next (csv .reader (['a,b\r \n c,d' ]))
412402
413- # TODO: RUSTPYTHON
414- @unittest .expectedFailure
403+ @unittest .expectedFailure # TODO: RUSTPYTHON
415404 def test_read_eof (self ):
416405 self ._read_test (['a,"' ], [['a' , '' ]])
417406 self ._read_test (['"a' ], [['a' ]])
@@ -421,8 +410,7 @@ def test_read_eof(self):
421410 self .assertRaises (csv .Error , self ._read_test ,
422411 ['^' ], [], escapechar = '^' , strict = True )
423412
424- # TODO: RUSTPYTHON
425- @unittest .expectedFailure
413+ @unittest .expectedFailure # TODO: RUSTPYTHON
426414 def test_read_nul (self ):
427415 self ._read_test (['\0 ' ], [['\0 ' ]])
428416 self ._read_test (['a,\0 b,c' ], [['a' , '\0 b' , 'c' ]])
@@ -435,8 +423,7 @@ def test_read_delimiter(self):
435423 self ._read_test (['a;b;c' ], [['a' , 'b' , 'c' ]], delimiter = ';' )
436424 self ._read_test (['a\0 b\0 c' ], [['a' , 'b' , 'c' ]], delimiter = '\0 ' )
437425
438- # TODO: RUSTPYTHON
439- @unittest .expectedFailure
426+ @unittest .expectedFailure # TODO: RUSTPYTHON
440427 def test_read_escape (self ):
441428 self ._read_test (['a,\\ b,c' ], [['a' , 'b' , 'c' ]], escapechar = '\\ ' )
442429 self ._read_test (['a,b\\ ,c' ], [['a' , 'b,c' ]], escapechar = '\\ ' )
@@ -449,8 +436,7 @@ def test_read_escape(self):
449436 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]], escapechar = None )
450437 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]])
451438
452- # TODO: RUSTPYTHON
453- @unittest .expectedFailure
439+ @unittest .expectedFailure # TODO: RUSTPYTHON
454440 def test_read_quoting (self ):
455441 self ._read_test (['1,",3,",5' ], [['1' , ',3,' , '5' ]])
456442 self ._read_test (['1,",3,",5' ], [['1' , '"' , '3' , '"' , '5' ]],
@@ -487,8 +473,7 @@ def test_read_quoting(self):
487473 self ._read_test (['1\\ .5,\\ .5,"\\ .5"' ], [[1.5 , 0.5 , ".5" ]],
488474 quoting = csv .QUOTE_STRINGS , escapechar = '\\ ' )
489475
490- # TODO: RUSTPYTHON; panic
491- @unittest .skip ("TODO: RUSTPYTHON; slice index starts at 1 but ends at 0" )
476+ @unittest .skip ('TODO: RUSTPYTHON; slice index starts at 1 but ends at 0' )
492477 def test_read_skipinitialspace (self ):
493478 self ._read_test (['no space, space, spaces,\t tab' ],
494479 [['no space' , 'space' , 'spaces' , '\t tab' ]],
@@ -503,8 +488,7 @@ def test_read_skipinitialspace(self):
503488 [[None , None , None ]],
504489 skipinitialspace = True , quoting = csv .QUOTE_STRINGS )
505490
506- # TODO: RUSTPYTHON
507- @unittest .expectedFailure
491+ @unittest .expectedFailure # TODO: RUSTPYTHON
508492 def test_read_space_delimiter (self ):
509493 self ._read_test (['a b' , ' a ' , ' ' , '' ],
510494 [['a' , '' , '' , 'b' ], ['' , '' , 'a' , '' , '' ], ['' , '' , '' ], []],
@@ -544,8 +528,7 @@ def test_read_linenum(self):
544528 self .assertRaises (StopIteration , next , r )
545529 self .assertEqual (r .line_num , 3 )
546530
547- # TODO: RUSTPYTHON
548- @unittest .expectedFailure
531+ @unittest .expectedFailure # TODO: RUSTPYTHON
549532 def test_roundtrip_quoteed_newlines (self ):
550533 rows = [
551534 ['\n a' , 'b\n c' , 'd\n ' ],
@@ -564,8 +547,7 @@ def test_roundtrip_quoteed_newlines(self):
564547 for i , row in enumerate (csv .reader (fileobj )):
565548 self .assertEqual (row , rows [i ])
566549
567- # TODO: RUSTPYTHON
568- @unittest .expectedFailure
550+ @unittest .expectedFailure # TODO: RUSTPYTHON
569551 def test_roundtrip_escaped_unquoted_newlines (self ):
570552 rows = [
571553 ['\n a' , 'b\n c' , 'd\n ' ],
@@ -680,8 +662,7 @@ def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
680662 fileobj .seek (0 )
681663 self .assertEqual (fileobj .read (), expected )
682664
683- # TODO: RUSTPYTHON
684- @unittest .expectedFailure
665+ @unittest .expectedFailure # TODO: RUSTPYTHON
685666 def test_dialect_apply (self ):
686667 class testA (csv .excel ):
687668 delimiter = "\t "
@@ -717,8 +698,7 @@ def test_copy(self):
717698 dialect = csv .get_dialect (name )
718699 self .assertRaises (TypeError , copy .copy , dialect )
719700
720- # TODO: RUSTPYTHON
721- @unittest .expectedFailure
701+ @unittest .expectedFailure # TODO: RUSTPYTHON
722702 def test_pickle (self ):
723703 for name in csv .list_dialects ():
724704 dialect = csv .get_dialect (name )
@@ -805,8 +785,7 @@ def test_quoted_quote(self):
805785 '"I see," said the blind man' ,
806786 'as he picked up his hammer and saw' ]])
807787
808- # TODO: RUSTPYTHON
809- @unittest .expectedFailure
788+ @unittest .expectedFailure # TODO: RUSTPYTHON
810789 def test_quoted_nl (self ):
811790 input = '''\
812791 1,2,3,"""I see,""
@@ -847,21 +826,18 @@ class EscapedExcel(csv.excel):
847826class TestEscapedExcel (TestCsvBase ):
848827 dialect = EscapedExcel ()
849828
850- # TODO: RUSTPYTHON
851- @unittest .expectedFailure
829+ @unittest .expectedFailure # TODO: RUSTPYTHON
852830 def test_escape_fieldsep (self ):
853831 self .writerAssertEqual ([['abc,def' ]], 'abc\\ ,def\r \n ' )
854832
855- # TODO: RUSTPYTHON
856- @unittest .expectedFailure
833+ @unittest .expectedFailure # TODO: RUSTPYTHON
857834 def test_read_escape_fieldsep (self ):
858835 self .readerAssertEqual ('abc\\ ,def\r \n ' , [['abc,def' ]])
859836
860837class TestDialectUnix (TestCsvBase ):
861838 dialect = 'unix'
862839
863- # TODO: RUSTPYTHON
864- @unittest .expectedFailure
840+ @unittest .expectedFailure # TODO: RUSTPYTHON
865841 def test_simple_writer (self ):
866842 self .writerAssertEqual ([[1 , 'abc def' , 'abc' ]], '"1","abc def","abc"\n ' )
867843
@@ -878,8 +854,7 @@ class TestQuotedEscapedExcel(TestCsvBase):
878854 def test_write_escape_fieldsep (self ):
879855 self .writerAssertEqual ([['abc,def' ]], '"abc,def"\r \n ' )
880856
881- # TODO: RUSTPYTHON
882- @unittest .expectedFailure
857+ @unittest .expectedFailure # TODO: RUSTPYTHON
883858 def test_read_escape_fieldsep (self ):
884859 self .readerAssertEqual ('"abc\\ ,def"\r \n ' , [['abc,def' ]])
885860
@@ -1076,8 +1051,7 @@ def test_read_multi(self):
10761051 "s1" : 'abc' ,
10771052 "s2" : 'def' })
10781053
1079- # TODO: RUSTPYTHON
1080- @unittest .expectedFailure
1054+ @unittest .expectedFailure # TODO: RUSTPYTHON
10811055 def test_read_with_blanks (self ):
10821056 reader = csv .DictReader (["1,2,abc,4,5,6\r \n " ,"\r \n " ,
10831057 "1,2,abc,4,5,6\r \n " ],
@@ -1129,8 +1103,7 @@ def test_float_write(self):
11291103 fileobj .seek (0 )
11301104 self .assertEqual (fileobj .read (), expected )
11311105
1132- # TODO: RUSTPYTHON
1133- @unittest .expectedFailure
1106+ @unittest .expectedFailure # TODO: RUSTPYTHON
11341107 def test_char_write (self ):
11351108 import array , string
11361109 a = array .array ('w' , string .ascii_letters )
@@ -1278,8 +1251,7 @@ class mydialect(csv.Dialect):
12781251 self .assertEqual (str (cm .exception ),
12791252 '"lineterminator" must be a string' )
12801253
1281- # TODO: RUSTPYTHON
1282- @unittest .expectedFailure
1254+ @unittest .expectedFailure # TODO: RUSTPYTHON
12831255 def test_invalid_chars (self ):
12841256 def create_invalid (field_name , value , ** kwargs ):
12851257 class mydialect (csv .Dialect ):
0 commit comments