Commits

Serhiy Storchaka  committed 6e0c3e4 Draft

Add bigmemtest decorator to test of issue #16335.

  • Participants
  • Parent commits f84a6c8
  • Branches 3.2

Comments (0)

Files changed (1)

File Lib/test/test_ucn.py

 
     @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():