Issue #20532: Tests which use _testcapi now are marked as CPython only.

This commit is contained in:
Serhiy Storchaka 2014-02-07 10:10:55 +02:00
commit f28ba369dd
29 changed files with 284 additions and 118 deletions

View file

@ -1187,8 +1187,13 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('...%(foo)f...' % {'foo':Float.PI,'def':123},
'...3.141593...')
@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):
@ -2315,6 +2320,7 @@ class UnicodeTest(string_tests.CommonTest,
b'%.%s', b'abc')
# Test PyUnicode_AsWideChar()
@support.cpython_only
def test_aswidechar(self):
from _testcapi import unicode_aswidechar
support.import_module('ctypes')
@ -2352,6 +2358,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')
@ -2386,6 +2393,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'),
@ -2401,6 +2409,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'),