]> granicus.if.org Git - python/commitdiff
Close #15494: test.support is now a package rather than a module
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 28 Jul 2013 10:56:19 +0000 (20:56 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 28 Jul 2013 10:56:19 +0000 (20:56 +1000)
Initial patch by Indra Talip

Lib/test/support/__init__.py [moved from Lib/test/support.py with 99% similarity]
Lib/test/test_linecache.py
Misc/ACKS
Misc/NEWS

similarity index 99%
rename from Lib/test/support.py
rename to Lib/test/support/__init__.py
index f6f5060d72b7eef74ba1b73eab37b3ed98495c80..24b405093ef2996936db7eb8e176bf13a68c6ebf 100644 (file)
@@ -789,9 +789,12 @@ if hasattr(os, "umask"):
         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):
index 7d14534d35bdc5755e371241e8127ecc63cca6f4..5fe0554572c102e149c45d3004160870cd9c4612 100644 (file)
@@ -11,7 +11,7 @@ INVALID_NAME = '!@$)(!@#_1'
 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)
 
index 5f0319300a0e8504128dec50fd63d29277e32673..2e38ee3dea7b8f8e6438496f37b933f060451dc3 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1237,6 +1237,7 @@ Péter Szabó
 Amir Szekely
 Arfrever Frehtes Taifersar Arahesis
 Hideaki Takahashi
+Indra Talip
 Neil Tallim
 Geoff Talvola
 Musashi Tamura
index 03c9a8e822e28c68ad260ccd46da762e7a875c38..378e3dacbd72c5b4c13214f8e319efd956f2eaf2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -571,6 +571,9 @@ Library
 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.