[Python-checkins] r83894 - python/branches/py3k/Lib/test/regrtest.py

florent.xicluna python-checkins at python.org
Mon Aug 9 18:56:43 CEST 2010


Author: florent.xicluna
Date: Mon Aug  9 18:56:43 2010
New Revision: 83894

Log:
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.
  ------------------------------------------------------------------------


Modified:
   python/branches/py3k/Lib/test/regrtest.py

Modified: python/branches/py3k/Lib/test/regrtest.py
==============================================================================
--- python/branches/py3k/Lib/test/regrtest.py	(original)
+++ python/branches/py3k/Lib/test/regrtest.py	Mon Aug  9 18:56:43 2010
@@ -187,14 +187,6 @@
         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
 # 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
@@ -224,6 +216,7 @@
 RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
                   'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui')
 
+TEMPDIR = os.path.abspath(tempfile.gettempdir())
 
 def usage(msg):
     print(msg, file=sys.stderr)
@@ -423,7 +416,7 @@
             found_garbage = []
 
     if single:
-        filename = 'pynexttest'
+        filename = os.path.join(TEMPDIR, 'pynexttest')
         try:
             fp = open(filename, 'r')
             next_test = fp.read().strip()
@@ -455,10 +448,11 @@
         args = []
 
     # 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("==", platform.python_implementation(), *sys.version.split())
-        print("==  ", platform.platform(aliased=True))
+        print("==  ", platform.platform(aliased=True),
+                      "%s-endian" % sys.byteorder)
         print("==  ", os.getcwd())
 
     alltests = findtests(testdir, stdtests, nottests)
@@ -1461,18 +1455,17 @@
     # to keep the test files in a subfolder.  It eases the cleanup of leftover
     # files using command "make distclean".
     if sysconfig.is_python_build():
-        parent_dir = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
-        if not os.path.exists(parent_dir):
-            os.mkdir(parent_dir)
-    else:
-        parent_dir = os.path.abspath(tempfile.gettempdir())
+        TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
+        TEMPDIR = os.path.abspath(TEMPDIR)
+        if not os.path.exists(TEMPDIR):
+            os.mkdir(TEMPDIR)
 
     # 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
     # testing (see the -j option).
     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
     # temporary and writable directory. If it's not possible to create or


More information about the Python-checkins mailing list