mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #20532: Tests which use _testcapi now are marked as CPython only.
This commit is contained in:
commit
f28ba369dd
29 changed files with 284 additions and 118 deletions
|
@ -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)):
|
||||
|
@ -505,9 +509,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue