Kaydet (Commit) 758c7d04 authored tarafından Martin Panter's avatar Martin Panter

Merge tests from 3.5

...@@ -5,7 +5,8 @@ import subprocess ...@@ -5,7 +5,8 @@ import subprocess
import shutil import shutil
from copy import copy from copy import copy
from test.support import (run_unittest, TESTFN, unlink, check_warnings, from test.support import (run_unittest,
import_module, TESTFN, unlink, check_warnings,
captured_stdout, skip_unless_symlink, change_cwd) captured_stdout, skip_unless_symlink, change_cwd)
import sysconfig import sysconfig
...@@ -389,7 +390,8 @@ class TestSysConfig(unittest.TestCase): ...@@ -389,7 +390,8 @@ class TestSysConfig(unittest.TestCase):
hasattr(sys.implementation, '_multiarch'), hasattr(sys.implementation, '_multiarch'),
'multiarch-specific test') 'multiarch-specific test')
def test_triplet_in_ext_suffix(self): def test_triplet_in_ext_suffix(self):
import ctypes, platform, re ctypes = import_module('ctypes')
import platform, re
machine = platform.machine() machine = platform.machine()
suffix = sysconfig.get_config_var('EXT_SUFFIX') suffix = sysconfig.get_config_var('EXT_SUFFIX')
if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine): if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
......
...@@ -465,6 +465,13 @@ class UnicodeTest(string_tests.CommonTest, ...@@ -465,6 +465,13 @@ class UnicodeTest(string_tests.CommonTest,
self.checkraises(TypeError, ' ', 'join', [1, 2, 3]) self.checkraises(TypeError, ' ', 'join', [1, 2, 3])
self.checkraises(TypeError, ' ', 'join', ['1', '2', 3]) self.checkraises(TypeError, ' ', 'join', ['1', '2', 3])
@unittest.skipIf(sys.maxsize > 2**32,
'needs too much memory on a 64-bit platform')
def test_join_overflow(self):
size = int(sys.maxsize**0.5) + 1
seq = ('A' * size,) * size
self.assertRaises(OverflowError, ''.join, seq)
def test_replace(self): def test_replace(self):
string_tests.CommonTest.test_replace(self) string_tests.CommonTest.test_replace(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment