[Python-checkins] cpython: Close #15494: test.support is now a package rather than a module

nick.coghlan python-checkins at python.org
Sun Jul 28 12:56:44 CEST 2013


http://hg.python.org/cpython/rev/203a77e74aa7
changeset:   84884:203a77e74aa7
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Sun Jul 28 20:56:19 2013 +1000
summary:
  Close #15494: test.support is now a package rather than a module

Initial patch by Indra Talip

files:
  Lib/test/support.py        |  7 +++++--
  Lib/test/test_linecache.py |  2 +-
  Misc/ACKS                  |  1 +
  Misc/NEWS                  |  3 +++
  4 files changed, 10 insertions(+), 3 deletions(-)


diff --git a/Lib/test/support.py b/Lib/test/support/__init__.py
rename from Lib/test/support.py
rename to Lib/test/support/__init__.py
--- a/Lib/test/support.py
+++ b/Lib/test/support/__init__.py
@@ -789,9 +789,12 @@
         finally:
             os.umask(oldmask)
 
+# TEST_HOME refers to the top level directory of the "test" package
+# that contains Python's regression test suite
+TEST_HOME = os.path.dirname(os.path.abspath(__file__))
 
-def findfile(file, here=__file__, subdir=None):
-    """Try to find a file on sys.path and the working directory.  If it is not
+def findfile(file, here=TEST_HOME, subdir=None):
+    """Try to find a file on sys.path or in the test directory.  If it is not
     found the argument passed to the function is returned (this does not
     necessarily signal failure; could still be the legitimate path)."""
     if os.path.isabs(file):
diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py
--- a/Lib/test/test_linecache.py
+++ b/Lib/test/test_linecache.py
@@ -11,7 +11,7 @@
 EMPTY = ''
 TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
 TESTS = TESTS.split()
-TEST_PATH = os.path.dirname(support.__file__)
+TEST_PATH = os.path.dirname(__file__)
 MODULES = "linecache abc".split()
 MODULE_PATH = os.path.dirname(FILENAME)
 
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1237,6 +1237,7 @@
 Amir Szekely
 Arfrever Frehtes Taifersar Arahesis
 Hideaki Takahashi
+Indra Talip
 Neil Tallim
 Geoff Talvola
 Musashi Tamura
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -571,6 +571,9 @@
 Tests
 -----
 
+- Issue #15494: test.support is now a package rather than a module (Initial
+  patch by Indra Talip)
+
 - Issue #17944: test_zipfile now discoverable and uses subclassing to
   generate tests for different compression types.  Fixed a bug with skipping
   some tests due to use of exhausted iterators.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list