mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merged manually from 2.7 branch to 3.x trunk.
------------------------------------------------------------------------ r80411 | florent.xicluna | 2010-04-23 19:59:10 +0200 (ven. 23 avril 2010) | 2 lignes Remove ImportWarnings filters. They become obsolete after r79310, issue #8205. ------------------------------------------------------------------------ r80412 | florent.xicluna | 2010-04-23 20:10:12 +0200 (ven. 23 avril 2010) | 2 lignes Fix the "regrtest -s" switch. ------------------------------------------------------------------------ r81140 | florent.xicluna | 2010-05-13 19:05:29 +0200 (jeu. 13 mai 2010) | 3 lignes Add sensible information about the OS X platform to diagnose issue #8423: test_pep277 fails on "x86 Tiger" buildbot but not on "PPC Tiger". ------------------------------------------------------------------------ r81141 | florent.xicluna | 2010-05-13 20:16:06 +0200 (jeu. 13 mai 2010) | 2 lignes Revert the additional OS X information (r81140). Keep the endianness information. ------------------------------------------------------------------------
This commit is contained in:
parent
da3b5bf3d8
commit
ec882214fe
1 changed files with 10 additions and 17 deletions
|
@ -187,14 +187,6 @@ for module in sys.modules.values():
|
||||||
module.__file__ = os.path.abspath(module.__file__)
|
module.__file__ = os.path.abspath(module.__file__)
|
||||||
|
|
||||||
|
|
||||||
# Ignore ImportWarnings that only occur in the source tree,
|
|
||||||
# (because of modules with the same name as source-directories in Modules/)
|
|
||||||
for mod in ("ctypes", "gzip", "zipfile", "tarfile", "encodings.zlib_codec",
|
|
||||||
"test.test_zipimport", "test.test_zlib", "test.test_zipfile",
|
|
||||||
"test.test_codecs", "test.string_tests"):
|
|
||||||
warnings.filterwarnings(module=".*%s$" % (mod,),
|
|
||||||
action="ignore", category=ImportWarning)
|
|
||||||
|
|
||||||
# MacOSX (a.k.a. Darwin) has a default stack size that is too small
|
# MacOSX (a.k.a. Darwin) has a default stack size that is too small
|
||||||
# for deeply recursive regular expressions. We see this as crashes in
|
# for deeply recursive regular expressions. We see this as crashes in
|
||||||
# the Python test suite when running test_re.py and test_sre.py. The
|
# the Python test suite when running test_re.py and test_sre.py. The
|
||||||
|
@ -224,6 +216,7 @@ from test import support
|
||||||
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
|
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
|
||||||
'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui')
|
'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui')
|
||||||
|
|
||||||
|
TEMPDIR = os.path.abspath(tempfile.gettempdir())
|
||||||
|
|
||||||
def usage(msg):
|
def usage(msg):
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
|
@ -423,7 +416,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
||||||
found_garbage = []
|
found_garbage = []
|
||||||
|
|
||||||
if single:
|
if single:
|
||||||
filename = 'pynexttest'
|
filename = os.path.join(TEMPDIR, 'pynexttest')
|
||||||
try:
|
try:
|
||||||
fp = open(filename, 'r')
|
fp = open(filename, 'r')
|
||||||
next_test = fp.read().strip()
|
next_test = fp.read().strip()
|
||||||
|
@ -455,10 +448,11 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
# For a partial run, we do not need to clutter the output.
|
# For a partial run, we do not need to clutter the output.
|
||||||
if verbose or not (quiet or tests or args):
|
if verbose or not (quiet or single or tests or args):
|
||||||
# Print basic platform information
|
# Print basic platform information
|
||||||
print("==", platform.python_implementation(), *sys.version.split())
|
print("==", platform.python_implementation(), *sys.version.split())
|
||||||
print("== ", platform.platform(aliased=True))
|
print("== ", platform.platform(aliased=True),
|
||||||
|
"%s-endian" % sys.byteorder)
|
||||||
print("== ", os.getcwd())
|
print("== ", os.getcwd())
|
||||||
|
|
||||||
alltests = findtests(testdir, stdtests, nottests)
|
alltests = findtests(testdir, stdtests, nottests)
|
||||||
|
@ -1461,18 +1455,17 @@ if __name__ == '__main__':
|
||||||
# to keep the test files in a subfolder. It eases the cleanup of leftover
|
# to keep the test files in a subfolder. It eases the cleanup of leftover
|
||||||
# files using command "make distclean".
|
# files using command "make distclean".
|
||||||
if sysconfig.is_python_build():
|
if sysconfig.is_python_build():
|
||||||
parent_dir = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
|
TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
|
||||||
if not os.path.exists(parent_dir):
|
TEMPDIR = os.path.abspath(TEMPDIR)
|
||||||
os.mkdir(parent_dir)
|
if not os.path.exists(TEMPDIR):
|
||||||
else:
|
os.mkdir(TEMPDIR)
|
||||||
parent_dir = os.path.abspath(tempfile.gettempdir())
|
|
||||||
|
|
||||||
# Define a writable temp dir that will be used as cwd while running
|
# Define a writable temp dir that will be used as cwd while running
|
||||||
# the tests. The name of the dir includes the pid to allow parallel
|
# the tests. The name of the dir includes the pid to allow parallel
|
||||||
# testing (see the -j option).
|
# testing (see the -j option).
|
||||||
TESTCWD = 'test_python_{}'.format(os.getpid())
|
TESTCWD = 'test_python_{}'.format(os.getpid())
|
||||||
|
|
||||||
TESTCWD = os.path.join(parent_dir, TESTCWD)
|
TESTCWD = os.path.join(TEMPDIR, TESTCWD)
|
||||||
|
|
||||||
# Run the tests in a context manager that temporary changes the CWD to a
|
# Run the tests in a context manager that temporary changes the CWD to a
|
||||||
# temporary and writable directory. If it's not possible to create or
|
# temporary and writable directory. If it's not possible to create or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue