@@ -150,6 +150,8 @@ def _write_error_test(self, exc, fields, **kwargs):
150150 fileobj .seek (0 )
151151 self .assertEqual (fileobj .read (), '' )
152152
153+ # TODO: RUSTPYTHON ''\r\n to ""\r\n unsupported
154+ @unittest .expectedFailure
153155 def test_write_arg_valid (self ):
154156 self ._write_error_test (csv .Error , None )
155157 self ._write_test ((), '' )
@@ -175,6 +177,8 @@ def test_write_bigfield(self):
175177 self ._write_test ([bigstring ,bigstring ], '%s,%s' % \
176178 (bigstring , bigstring ))
177179
180+ # TODO: RUSTPYTHON quoting style check is unsupported
181+ @unittest .expectedFailure
178182 def test_write_quoting (self ):
179183 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' )
180184 self ._write_error_test (csv .Error , ['a' ,1 ,'p,q' ],
@@ -192,6 +196,8 @@ def test_write_quoting(self):
192196 self ._write_test (['a' ,'' ,None ,1 ], '"a","",,"1"' ,
193197 quoting = csv .QUOTE_NOTNULL )
194198
199+ # TODO: RUSTPYTHON doublequote check is unsupported
200+ @unittest .expectedFailure
195201 def test_write_escape (self ):
196202 self ._write_test (['a' ,1 ,'p,q' ], 'a,1,"p,q"' ,
197203 escapechar = '\\ ' )
@@ -223,6 +229,8 @@ def test_write_escape(self):
223229 self ._write_test (['C\\ ' , '6' , '7' , 'X"' ], 'C\\ \\ ,6,7,"X"""' ,
224230 escapechar = '\\ ' , quoting = csv .QUOTE_MINIMAL )
225231
232+ # TODO: RUSTPYTHON lineterminator double char unsupported
233+ @unittest .expectedFailure
226234 def test_write_lineterminator (self ):
227235 for lineterminator in '\r \n ' , '\n ' , '\r ' , '!@#' , '\0 ' :
228236 with self .subTest (lineterminator = lineterminator ):
@@ -234,6 +242,8 @@ def test_write_lineterminator(self):
234242 f'a,b{ lineterminator } '
235243 f'1,2{ lineterminator } ' )
236244
245+ # TODO: RUSTPYTHON ''\r\n to ""\r\n unspported
246+ @unittest .expectedFailure
237247 def test_write_iterable (self ):
238248 self ._write_test (iter (['a' , 1 , 'p,q' ]), 'a,1,"p,q"' )
239249 self ._write_test (iter (['a' , 1 , None ]), 'a,1,' )
@@ -298,6 +308,8 @@ def _read_test(self, input, expect, **kwargs):
298308 result = list (reader )
299309 self .assertEqual (result , expect )
300310
311+ # TODO RUSTPYTHON strict mode is unsupported
312+ @unittest .expectedFailure
301313 def test_read_oddinputs (self ):
302314 self ._read_test ([], [])
303315 self ._read_test (['' ], [[]])
@@ -317,6 +329,8 @@ def test_read_eol(self):
317329 self .assertRaises (csv .Error , self ._read_test , ['a,b\n c,d' ], [])
318330 self .assertRaises (csv .Error , self ._read_test , ['a,b\r \n c,d' ], [])
319331
332+ # TODO RUSTPYTHON double quote umimplement
333+ @unittest .expectedFailure
320334 def test_read_eof (self ):
321335 self ._read_test (['a,"' ], [['a' , '' ]])
322336 self ._read_test (['"a' ], [['a' ]])
@@ -326,6 +340,8 @@ def test_read_eof(self):
326340 self .assertRaises (csv .Error , self ._read_test ,
327341 ['^' ], [], escapechar = '^' , strict = True )
328342
343+ # TODO RUSTPYTHON
344+ @unittest .expectedFailure
329345 def test_read_nul (self ):
330346 self ._read_test (['\0 ' ], [['\0 ' ]])
331347 self ._read_test (['a,\0 b,c' ], [['a' , '\0 b' , 'c' ]])
@@ -338,6 +354,8 @@ def test_read_delimiter(self):
338354 self ._read_test (['a;b;c' ], [['a' , 'b' , 'c' ]], delimiter = ';' )
339355 self ._read_test (['a\0 b\0 c' ], [['a' , 'b' , 'c' ]], delimiter = '\0 ' )
340356
357+ # TODO RUSTPYTHON
358+ @unittest .expectedFailure
341359 def test_read_escape (self ):
342360 self ._read_test (['a,\\ b,c' ], [['a' , 'b' , 'c' ]], escapechar = '\\ ' )
343361 self ._read_test (['a,b\\ ,c' ], [['a' , 'b,c' ]], escapechar = '\\ ' )
@@ -350,6 +368,8 @@ def test_read_escape(self):
350368 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]], escapechar = None )
351369 self ._read_test (['a,\\ b,c' ], [['a' , '\\ b' , 'c' ]])
352370
371+ # TODO RUSTPYTHON escapechar unsupported
372+ @unittest .expectedFailure
353373 def test_read_quoting (self ):
354374 self ._read_test (['1,",3,",5' ], [['1' , ',3,' , '5' ]])
355375 self ._read_test (['1,",3,",5' ], [['1' , '"' , '3' , '"' , '5' ]],
@@ -402,6 +422,8 @@ def test_read_linenum(self):
402422 self .assertRaises (StopIteration , next , r )
403423 self .assertEqual (r .line_num , 3 )
404424
425+ # TODO: RUSTPYTHON only '\r\n' unsupported
426+ @unittest .expectedFailure
405427 def test_roundtrip_quoteed_newlines (self ):
406428 with TemporaryFile ("w+" , encoding = "utf-8" , newline = '' ) as fileobj :
407429 writer = csv .writer (fileobj )
@@ -411,6 +433,8 @@ def test_roundtrip_quoteed_newlines(self):
411433 for i , row in enumerate (csv .reader (fileobj )):
412434 self .assertEqual (row , rows [i ])
413435
436+ # TODO: RUSTPYTHON only '\r\n' unsupported
437+ @unittest .expectedFailure
414438 def test_roundtrip_escaped_unquoted_newlines (self ):
415439 with TemporaryFile ("w+" , encoding = "utf-8" , newline = '' ) as fileobj :
416440 writer = csv .writer (fileobj ,quoting = csv .QUOTE_NONE ,escapechar = "\\ " )
@@ -512,6 +536,8 @@ def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
512536 fileobj .seek (0 )
513537 self .assertEqual (fileobj .read (), expected )
514538
539+ # TODO: RUSTPYTHON
540+ @unittest .expectedFailure
515541 def test_dialect_apply (self ):
516542 class testA (csv .excel ):
517543 delimiter = "\t "
@@ -555,6 +581,8 @@ def test_copy(self):
555581 dialect = csv .get_dialect (name )
556582 self .assertRaises (TypeError , copy .copy , dialect )
557583
584+ # TODO: RUSTPYTHON
585+ @unittest .expectedFailure
558586 def test_pickle (self ):
559587 for name in csv .list_dialects ():
560588 dialect = csv .get_dialect (name )
@@ -641,6 +669,8 @@ def test_quoted_quote(self):
641669 '"I see," said the blind man' ,
642670 'as he picked up his hammer and saw' ]])
643671
672+ # Rustpython TODO
673+ @unittest .expectedFailure
644674 def test_quoted_nl (self ):
645675 input = '''\
646676 1,2,3,"""I see,""
@@ -681,15 +711,21 @@ class EscapedExcel(csv.excel):
681711class TestEscapedExcel (TestCsvBase ):
682712 dialect = EscapedExcel ()
683713
714+ # TODO RUSTPYTHON
715+ @unittest .expectedFailure
684716 def test_escape_fieldsep (self ):
685717 self .writerAssertEqual ([['abc,def' ]], 'abc\\ ,def\r \n ' )
686718
719+ # TODO RUSTPYTHON
720+ @unittest .expectedFailure
687721 def test_read_escape_fieldsep (self ):
688722 self .readerAssertEqual ('abc\\ ,def\r \n ' , [['abc,def' ]])
689723
690724class TestDialectUnix (TestCsvBase ):
691725 dialect = 'unix'
692726
727+ # TODO RUSTPYTHON
728+ @unittest .expectedFailure
693729 def test_simple_writer (self ):
694730 self .writerAssertEqual ([[1 , 'abc def' , 'abc' ]], '"1","abc def","abc"\n ' )
695731
@@ -706,6 +742,8 @@ class TestQuotedEscapedExcel(TestCsvBase):
706742 def test_write_escape_fieldsep (self ):
707743 self .writerAssertEqual ([['abc,def' ]], '"abc,def"\r \n ' )
708744
745+ # TODO RUSTPYTHON
746+ @unittest .expectedFailure
709747 def test_read_escape_fieldsep (self ):
710748 self .readerAssertEqual ('"abc\\ ,def"\r \n ' , [['abc,def' ]])
711749
@@ -902,6 +940,8 @@ def test_read_multi(self):
902940 "s1" : 'abc' ,
903941 "s2" : 'def' })
904942
943+ # TODO RUSTPYTHON
944+ @unittest .expectedFailure
905945 def test_read_with_blanks (self ):
906946 reader = csv .DictReader (["1,2,abc,4,5,6\r \n " ,"\r \n " ,
907947 "1,2,abc,4,5,6\r \n " ],
0 commit comments