summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ucn.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-07 08:06:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-07 08:06:39 (GMT)
commit5cfc79deaeabf4af3c767665098a37da9f375eda (patch)
tree2696e5c9674d11398f0d207d58d1fcdd3ee420eb /Lib/test/test_ucn.py
parentfe4ef392d5df73639337f02db2ad8100d615067d (diff)
downloadcpython-5cfc79deaeabf4af3c767665098a37da9f375eda.zip
cpython-5cfc79deaeabf4af3c767665098a37da9f375eda.tar.gz
cpython-5cfc79deaeabf4af3c767665098a37da9f375eda.tar.bz2
Issue #20532: Tests which use _testcapi now are marked as CPython only.
Diffstat (limited to 'Lib/test/test_ucn.py')
-rw-r--r--Lib/test/test_ucn.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index 2e63745..de71680 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -9,12 +9,16 @@ Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
import unittest
import unicodedata
-import _testcapi
from test import support
from http.client import HTTPException
from test.test_normalization import check_version
+try:
+ from _testcapi import INT_MAX, PY_SSIZE_T_MAX, UINT_MAX
+except ImportError:
+ INT_MAX = PY_SSIZE_T_MAX = UINT_MAX = 2**64 - 1
+
class UnicodeNamesTest(unittest.TestCase):
def checkletter(self, name, code):
@@ -216,15 +220,13 @@ class UnicodeNamesTest(unittest.TestCase):
str, b"\\NSPACE", 'unicode-escape', 'strict'
)
- @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
- "needs UINT_MAX < SIZE_MAX")
- @support.bigmemtest(size=_testcapi.UINT_MAX + 1,
- memuse=2 + 1, dry_run=False)
+ @support.cpython_only
+ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
+ @support.bigmemtest(size=UINT_MAX + 1, memuse=2 + 1, dry_run=False)
def test_issue16335(self, size):
# very very long bogus character name
- x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
- self.assertEqual(len(x), len(b'\\N{SPACE}') +
- (_testcapi.UINT_MAX + 1))
+ x = b'\\N{SPACE' + b'x' * (UINT_MAX + 1) + b'}'
+ self.assertEqual(len(x), len(b'\\N{SPACE}') + (UINT_MAX + 1))
self.assertRaisesRegex(UnicodeError,
'unknown Unicode character name',
x.decode, 'unicode-escape'