mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Use bigmemtest decorator for test of issue #16335.
This commit is contained in:
commit
529230142f
1 changed files with 10 additions and 11 deletions
|
@ -218,18 +218,17 @@ class UnicodeNamesTest(unittest.TestCase):
|
||||||
|
|
||||||
@unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
|
@unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
|
||||||
"needs UINT_MAX < SIZE_MAX")
|
"needs UINT_MAX < SIZE_MAX")
|
||||||
def test_issue16335(self):
|
@support.bigmemtest(size=_testcapi.UINT_MAX + 1,
|
||||||
|
memuse=1 + 1, dry_run=False)
|
||||||
|
def test_issue16335(self, size):
|
||||||
# very very long bogus character name
|
# very very long bogus character name
|
||||||
try:
|
x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
|
||||||
x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
|
self.assertEqual(len(x), len(b'\\N{SPACE}') +
|
||||||
self.assertEqual(len(x), len(b'\\N{SPACE}') +
|
(_testcapi.UINT_MAX + 1))
|
||||||
(_testcapi.UINT_MAX + 1))
|
self.assertRaisesRegex(UnicodeError,
|
||||||
self.assertRaisesRegex(UnicodeError,
|
'unknown Unicode character name',
|
||||||
'unknown Unicode character name',
|
x.decode, 'unicode-escape'
|
||||||
x.decode, 'unicode-escape'
|
)
|
||||||
)
|
|
||||||
except MemoryError:
|
|
||||||
raise unittest.SkipTest("not enough memory")
|
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue