mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_csv.py to 3.14.5 (#7831)
* Update `test_csv.py` to 3.14.5 * Mark failing test
This commit is contained in:
1 parent
4a46e84eb9
commit
ad6cc8f0a2
1 file changed
+28
Vendored
+28
@@ -571,6 +571,34 @@ class Test_Csv(unittest.TestCase):
|
||||
self.assertEqual(row, rows[i])
|
||||
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: Error not raised
|
||||
def test_reader_reentrant_iterator(self):
|
||||
# gh-145105: re-entering the reader from the iterator must not crash.
|
||||
class ReentrantIter:
|
||||
def __init__(self):
|
||||
self.reader = None
|
||||
self.n = 0
|
||||
def __iter__(self):
|
||||
return self
|
||||
def __next__(self):
|
||||
self.n += 1
|
||||
if self.n == 1:
|
||||
try:
|
||||
next(self.reader)
|
||||
except StopIteration:
|
||||
pass
|
||||
return "a,b"
|
||||
if self.n == 2:
|
||||
return "x"
|
||||
raise StopIteration
|
||||
|
||||
it = ReentrantIter()
|
||||
reader = csv.reader(it)
|
||||
it.reader = reader
|
||||
with self.assertRaises(csv.Error):
|
||||
next(reader)
|
||||
|
||||
|
||||
class TestDialectRegistry(unittest.TestCase):
|
||||
def test_registry_badargs(self):
|
||||
self.assertRaises(TypeError, csv.list_dialects, None)
|
||||
|
||||
Reference in new issue
Block a user