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

@ -812,16 +812,6 @@ class StrTest(string_tests.StringLikeTest,
self.assertFalse("©".isidentifier())
self.assertFalse("0".isidentifier())
@support.cpython_only
@support.requires_legacy_unicode_capi()
@unittest.skipIf(_testcapi is None, 'need _testcapi module')
def test_isidentifier_legacy(self):
u = '𝖀𝖓𝖎𝖈𝖔𝖉𝖊'
self.assertTrue(u.isidentifier())
with warnings_helper.check_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier())
def test_isprintable(self):
self.assertTrue("".isprintable())
self.assertTrue(" ".isprintable())
@ -2489,26 +2479,6 @@ class StrTest(string_tests.StringLikeTest,
self.assertEqual(args[0], text)
self.assertEqual(len(args), 1)
@support.cpython_only
@support.requires_legacy_unicode_capi()
@unittest.skipIf(_testcapi is None, 'need _testcapi module')
def test_resize(self):
for length in range(1, 100, 7):
# generate a fresh string (refcount=1)
text = 'a' * length + 'b'
# fill wstr internal field
with self.assertWarns(DeprecationWarning):
abc = _testcapi.getargs_u(text)
self.assertEqual(abc, text)
# resize text: wstr field must be cleared and then recomputed
text += 'c'
with self.assertWarns(DeprecationWarning):
abcdef = _testcapi.getargs_u(text)
self.assertNotEqual(abc, abcdef)
self.assertEqual(abcdef, text)
def test_compare(self):
# Issue #17615
N = 10