Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5292301

Browse files
Use bigmemtest decorator for test of issue #16335.
2 parents 014791f + e45dac4 commit 5292301

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

Lib/test/test_ucn.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,17 @@ def test_strict_error_handling(self):
218218

219219
@unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
220220
"needs UINT_MAX < SIZE_MAX")
221-
def test_issue16335(self):
221+
@support.bigmemtest(size=_testcapi.UINT_MAX + 1,
222+
memuse=1 + 1, dry_run=False)
223+
def test_issue16335(self, size):
222224
# very very long bogus character name
223-
try:
224-
x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
225-
self.assertEqual(len(x), len(b'\\N{SPACE}') +
226-
(_testcapi.UINT_MAX + 1))
227-
self.assertRaisesRegex(UnicodeError,
228-
'unknown Unicode character name',
229-
x.decode, 'unicode-escape'
230-
)
231-
except MemoryError:
232-
raise unittest.SkipTest("not enough memory")
225+
x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
226+
self.assertEqual(len(x), len(b'\\N{SPACE}') +
227+
(_testcapi.UINT_MAX + 1))
228+
self.assertRaisesRegex(UnicodeError,
229+
'unknown Unicode character name',
230+
x.decode, 'unicode-escape'
231+
)
233232

234233

235234
def test_main():

0 commit comments

Comments
 (0)