gh-109050: Remove remaining tests for legacy Unicode C API (GH-109068)

This commit is contained in:
Serhiy Storchaka 2023-09-09 08:44:46 +03:00 committed by GitHub
parent 17f994174d
commit b4131a13cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 197 deletions

View file

@ -281,18 +281,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)