diff options
Diffstat (limited to 'Lib/test/test_ucn.py')
-rw-r--r-- | Lib/test/test_ucn.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py index ff4c4f1..05557ae 100644 --- a/Lib/test/test_ucn.py +++ b/Lib/test/test_ucn.py @@ -222,13 +222,14 @@ class UnicodeNamesTest(unittest.TestCase): # 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") - 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(): |