mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-109050: Remove remaining tests for legacy Unicode C API (GH-109068)
This commit is contained in:
parent
17f994174d
commit
b4131a13cb
6 changed files with 1 additions and 197 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue