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

This commit is contained in:
Serhiy Storchaka 2014-02-07 10:06:39 +02:00
parent fe4ef392d5
commit 5cfc79deae
25 changed files with 239 additions and 106 deletions

View file

@ -1,7 +1,6 @@
import unittest
import sys
import os
import _testcapi
from test import support
# Skip this test if the _tkinter module wasn't built.
@ -13,6 +12,11 @@ support.import_fresh_module('tkinter')
from tkinter import Tcl
from _tkinter import TclError
try:
from _testcapi import INT_MAX, PY_SSIZE_T_MAX
except ImportError:
INT_MAX = PY_SSIZE_T_MAX = sys.maxsize
tcl_version = _tkinter.TCL_VERSION.split('.')
try:
for i in range(len(tcl_version)):
@ -539,9 +543,9 @@ class BigmemTclTest(unittest.TestCase):
def setUp(self):
self.interp = Tcl()
@unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
"needs UINT_MAX < SIZE_MAX")
@support.bigmemtest(size=_testcapi.INT_MAX + 1, memuse=5, dry_run=False)
@support.cpython_only
@unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
@support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False)
def test_huge_string(self, size):
value = ' ' * size
self.assertRaises(OverflowError, self.interp.call, 'set', '_', value)