summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-07-28 10:56:19 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-07-28 10:56:19 (GMT)
commitfb15aa1e0873043548df782ace51fe1340ea559a (patch)
treeacbce27d07285d86e14b039cfe6521d95032859c /Lib/test
parente8c45d6d0eda74a8f13dcac9d0c593bbcb21e38b (diff)
downloadcpython-fb15aa1e0873043548df782ace51fe1340ea559a.zip
cpython-fb15aa1e0873043548df782ace51fe1340ea559a.tar.gz
cpython-fb15aa1e0873043548df782ace51fe1340ea559a.tar.bz2
Close #15494: test.support is now a package rather than a module
Initial patch by Indra Talip
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/support/__init__.py (renamed from Lib/test/support.py)7
-rw-r--r--Lib/test/test_linecache.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/support.py b/Lib/test/support/__init__.py
index f6f5060..24b4050 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support/__init__.py
@@ -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):
diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py
index 7d14534..5fe0554 100644
--- a/Lib/test/test_linecache.py
+++ b/Lib/test/test_linecache.py
@@ -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)