mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
fix test_csv
This commit is contained in:
12
Lib/test/test_csv.py
vendored
12
Lib/test/test_csv.py
vendored
@@ -291,18 +291,6 @@ class Test_Csv(unittest.TestCase):
|
||||
self.assertRaises(TypeError, writer.writerows, None)
|
||||
self.assertRaises(OSError, writer.writerows, BadIterable())
|
||||
|
||||
@support.cpython_only
|
||||
@support.requires_legacy_unicode_capi()
|
||||
@warnings_helper.ignore_warnings(category=DeprecationWarning)
|
||||
def test_writerows_legacy_strings(self):
|
||||
import _testcapi
|
||||
c = _testcapi.unicode_legacy_string('a')
|
||||
with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
|
||||
writer = csv.writer(fileobj)
|
||||
writer.writerows([[c]])
|
||||
fileobj.seek(0)
|
||||
self.assertEqual(fileobj.read(), "a\r\n")
|
||||
|
||||
def _read_test(self, input, expect, **kwargs):
|
||||
reader = csv.reader(input, **kwargs)
|
||||
result = list(reader)
|
||||
|
||||
Reference in New Issue
Block a user