@@ -144,18 +144,17 @@ def test_strict_error_handling(self):
144144
145145 @unittest .skipUnless (_testcapi .INT_MAX < _testcapi .PY_SSIZE_T_MAX ,
146146 "needs UINT_MAX < SIZE_MAX" )
147- def test_issue16335 (self ):
147+ @support .bigmemtest (size = _testcapi .UINT_MAX + 1 ,
148+ memuse = 1 + 4 // len ('\U00010000 ' ), dry_run = False )
149+ def test_issue16335 (self , size ):
148150 # very very long bogus character name
149- try :
150- x = b'\\ N{SPACE' + b'x' * (_testcapi .UINT_MAX + 1 ) + b'}'
151- self .assertEqual (len (x ), len (b'\\ N{SPACE}' ) +
152- (_testcapi .UINT_MAX + 1 ))
153- self .assertRaisesRegex (UnicodeError ,
154- 'unknown Unicode character name' ,
155- x .decode , 'unicode-escape'
156- )
157- except MemoryError :
158- raise unittest .SkipTest ("not enough memory" )
151+ x = b'\\ N{SPACE' + b'x' * (_testcapi .UINT_MAX + 1 ) + b'}'
152+ self .assertEqual (len (x ), len (b'\\ N{SPACE}' ) +
153+ (_testcapi .UINT_MAX + 1 ))
154+ self .assertRaisesRegex (UnicodeError ,
155+ 'unknown Unicode character name' ,
156+ x .decode , 'unicode-escape'
157+ )
159158
160159
161160def test_main ():
0 commit comments