8000 Close #15494: test.support is now a package rather than a module · python/cpython@fb15aa1 · GitHub
[go: up one dir, main page]

Skip to content

Commit fb15aa1

Browse files
committed
Close #15494: test.support is now a package rather than a module
Initial patch by Indra Talip
1 parent e8c45d6 commit fb15aa1

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Lib/test/support.py renamed to Lib/test/support/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,12 @@ def temp_umask(umask):
789789
finally:
790790
os.umask(oldmask)
791791

792+
# TEST_HOME refers to the top level directory of the "test" package
793+
# that contains Python's regression test suite
794+
TEST_HOME = os.path.dirname(os.path.abspath(__file__))
792795

793-
def findfile(file, here=__file__, subdir=None):
794-
"""Try to find a file on sys.path and the working directory. If it is not
796+
def findfile(file, here=TEST_HOME, subdir=None):
797+
"""Try to find a file on sys.path or in the test directory. If it is not
795798
found the argument passed to the function is returned (this does not
796799
necessarily signal failure; could still be the legitimate path)."""
797800
if os.path.isabs(file):

Lib/test/test_linecache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
EMPTY = ''
1212
TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
1313
TESTS = TESTS.split()
14-
TEST_PATH = os.path.dirname(support.__file__)
14+
TEST_PATH = os.path.dirname(__file__)
1515
MODULES = "linecache abc".split()
1616
MODULE_PATH = os.path.dirname(FILENAME)
1717

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ Péter Szabó
12371237
Amir Szekely
12381238
Arfrever Frehtes Taifersar Arahesis
12391239
Hideaki Takahashi
1240+
Indra Talip
12401241
Neil Tallim
12411242
Geoff Talvola
12421243
Musashi Tamura

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ Library
571571
Tests
572572
-----
573573

574+
- Issue #15494: test.support is now a package rather than a module (Initial
575+
patch by Indra Talip)
576+
574577
- Issue #17944: test_zipfile now discoverable and uses subclassing to
575578
generate tests for different compression types. Fixed a bug with skipping
576579
some tests due to use of exhausted iterators.

0 commit comments

Comments
 (0)
0