summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-07-28 11:06:50 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-07-28 11:06:50 (GMT)
commit69e3bda310f55816403e4c7fda42ab96d81c31be (patch)
tree8de978e382d156c8a5089e107944169b8dfa0b6b
parent725d9dd1a7ae29d2e592aa8f74f899d27bc941d4 (diff)
downloadcpython-69e3bda310f55816403e4c7fda42ab96d81c31be.zip
cpython-69e3bda310f55816403e4c7fda42ab96d81c31be.tar.gz
cpython-69e3bda310f55816403e4c7fda42ab96d81c31be.tar.bz2
Issue #15494: test.support is now a package rather than a module
Also including this change in 3.3 to help avoid spurious conflicts between the two most active branches. (Initial patch by Indra Talip)
-rw-r--r--Lib/test/support/__init__.py (renamed from Lib/test/support.py)7
-rw-r--r--Lib/test/test_linecache.py2
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
4 files changed, 10 insertions, 3 deletions
diff --git a/Lib/test/support.py b/Lib/test/support/__init__.py
index 7ab5ff7..3ebc49d 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support/__init__.py
@@ -787,9 +787,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)
diff --git a/Misc/ACKS b/Misc/ACKS
index 288f186..aaa8dd4 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1202,6 +1202,7 @@ Thenault Sylvain
Péter Szabó
Amir Szekely
Arfrever Frehtes Taifersar Arahesis
+Indra Talip
Neil Tallim
Geoff Talvola
Musashi Tamura
diff --git a/Misc/NEWS b/Misc/NEWS
index ff6fe06..853e738 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -222,6 +222,9 @@ IDLE
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.