Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 758c7d0

Browse files
committed
Merge tests from 3.5
2 parents 6b642c9 + b71c095 commit 758c7d0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Lib/test/test_sysconfig.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import shutil
66
from copy import copy
77

8-
from test.support import (run_unittest, TESTFN, unlink, check_warnings,
8+
from test.support import (run_unittest,
9+
import_module, TESTFN, unlink, check_warnings,
910
captured_stdout, skip_unless_symlink, change_cwd)
1011

1112
import sysconfig
@@ -389,7 +390,8 @@ def test_SO_in_vars(self):
389390
hasattr(sys.implementation, '_multiarch'),
390391
'multiarch-specific test')
391392
def test_triplet_in_ext_suffix(self):
392-
import ctypes, platform, re
393+
ctypes = import_module('ctypes')
394+
import platform, re
393395
machine = platform.machine()
394396
suffix = sysconfig.get_config_var('EXT_SUFFIX')
395397
if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):

Lib/test/test_unicode.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,13 @@ def __str__(self): return self.sval
465465
self.checkraises(TypeError, ' ', 'join', [1, 2, 3])
466466
self.checkraises(TypeError, ' ', 'join', ['1', '2', 3])
467467

468+
@unittest.skipIf(sys.maxsize > 2**32,
469+
'needs too much memory on a 64-bit platform')
470+
def test_join_overflow(self):
471+
size = int(sys.maxsize**0.5) + 1
472+
seq = ('A' * size,) * size
473+
self.assertRaises(OverflowError, ''.join, seq)
474+
468475
def test_replace(self):
469476
string_tests.CommonTest.test_replace(self)
470477

0 commit comments

Comments
 (0)