summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.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_unicode.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_unicode.py')
-rw-r--r--Lib/test/test_unicode.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index f6b2a3f..c2ede07 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1108,8 +1108,13 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('%.1s' % "a\xe9\u20ac", 'a')
self.assertEqual('%.2s' % "a\xe9\u20ac", 'a\xe9')
- @support.cpython_only
def test_formatting_huge_precision(self):
+ format_string = "%.{}f".format(sys.maxsize + 1)
+ with self.assertRaises(ValueError):
+ result = format_string % 2.34
+
+ @support.cpython_only
+ def test_formatting_huge_precision_c_limits(self):
from _testcapi import INT_MAX
format_string = "%.{}f".format(INT_MAX + 1)
with self.assertRaises(ValueError):
@@ -2090,6 +2095,7 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual(PyUnicode_FromFormat(b'%.%s', b'abc'), '%.%s')
# Test PyUnicode_AsWideChar()
+ @support.cpython_only
def test_aswidechar(self):
from _testcapi import unicode_aswidechar
support.import_module('ctypes')
@@ -2127,6 +2133,7 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual(wchar, nonbmp + '\0')
# Test PyUnicode_AsWideCharString()
+ @support.cpython_only
def test_aswidecharstring(self):
from _testcapi import unicode_aswidecharstring
support.import_module('ctypes')
@@ -2161,6 +2168,7 @@ class UnicodeTest(string_tests.CommonTest,
s += "4"
self.assertEqual(s, "3")
+ @support.cpython_only
def test_encode_decimal(self):
from _testcapi import unicode_encodedecimal
self.assertEqual(unicode_encodedecimal('123'),
@@ -2176,6 +2184,7 @@ class UnicodeTest(string_tests.CommonTest,
"^'decimal' codec can't encode character",
unicode_encodedecimal, "123\u20ac", "replace")
+ @support.cpython_only
def test_transform_decimal(self):
from _testcapi import unicode_transformdecimaltoascii as transform_decimal
self.assertEqual(transform_decimal('123'),