summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-14 06:26:51 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2017-01-14 06:26:51 (GMT)
commit758c7d044bb98da9e98654fa91961f54a915712d (patch)
tree02164ee4c30fa35d3248ff26bb9c7758167f1a5c /Lib
parent6b642c9a7165db52a7c7b41de9e80aa8f59eea3e (diff)
parentb71c0956d0904cfdc271cd10d40385c730cf8bcb (diff)
downloadcpython-758c7d044bb98da9e98654fa91961f54a915712d.zip
cpython-758c7d044bb98da9e98654fa91961f54a915712d.tar.gz
cpython-758c7d044bb98da9e98654fa91961f54a915712d.tar.bz2
Merge tests from 3.5
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sysconfig.py6
-rw-r--r--Lib/test/test_unicode.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 355bc61..a29ca96 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -5,7 +5,8 @@ import subprocess
import shutil
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)
import sysconfig
@@ -389,7 +390,8 @@ class TestSysConfig(unittest.TestCase):
hasattr(sys.implementation, '_multiarch'),
'multiarch-specific test')
def test_triplet_in_ext_suffix(self):
- import ctypes, platform, re
+ ctypes = import_module('ctypes')
+ import platform, re
machine = platform.machine()
suffix = sysconfig.get_config_var('EXT_SUFFIX')
if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 883c362..86ebd45 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -465,6 +465,13 @@ class UnicodeTest(string_tests.CommonTest,
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):
string_tests.CommonTest.test_replace(self)