diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-21 18:23:58 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-21 18:23:58 (GMT) |
commit | e45dac4ea94a93b6bc12376100e04a5b3330ffa6 (patch) | |
tree | e08676402837e9f64a1f4a1a46a769df5d3288ff /Lib/test/test_ucn.py | |
parent | 3b40b71217d7b73e59495de8cadd8fe1ad7cc6bc (diff) | |
download | cpython-e45dac4ea94a93b6bc12376100e04a5b3330ffa6.zip cpython-e45dac4ea94a93b6bc12376100e04a5b3330ffa6.tar.gz cpython-e45dac4ea94a93b6bc12376100e04a5b3330ffa6.tar.bz2 |
Add bigmemtest decorator to test of issue #16335.
Diffstat (limited to 'Lib/test/test_ucn.py')
-rw-r--r-- | Lib/test/test_ucn.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py index ebff0e1..6fae421 100644 --- a/Lib/test/test_ucn.py +++ b/Lib/test/test_ucn.py @@ -144,18 +144,17 @@ class UnicodeNamesTest(unittest.TestCase): @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") - def test_issue16335(self): + @support.bigmemtest(size=_testcapi.UINT_MAX + 1, + memuse=1 + 4 // len('\U00010000'), dry_run=False) + def test_issue16335(self, size): # very very long bogus character name - try: - x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}' - self.assertEqual(len(x), len(b'\\N{SPACE}') + - (_testcapi.UINT_MAX + 1)) - self.assertRaisesRegex(UnicodeError, - 'unknown Unicode character name', - x.decode, 'unicode-escape' - ) - except MemoryError: - raise unittest.SkipTest("not enough memory") + x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}' + self.assertEqual(len(x), len(b'\\N{SPACE}') + + (_testcapi.UINT_MAX + 1)) + self.assertRaisesRegex(UnicodeError, + 'unknown Unicode character name', + x.decode, 'unicode-escape' + ) def test_main(): |