summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-11 20:57:55 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-11 20:57:55 +0000
commit80e44f8737570c76c49f00594c818c37925d4748 (patch)
treef150c16c993179cffb288d8a2015b9ef0937dbcc
parent55669d04adf847f5428dc314cb79c016cc5b5595 (diff)
downloadcpython-git-80e44f8737570c76c49f00594c818c37925d4748.tar.gz
Merged revisions 76217 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76217 | antoine.pitrou | 2009-11-11 21:55:07 +0100 (mer., 11 nov. 2009) | 3 lines Issue #7295: Do not use a hardcoded file name in test_tarfile. ........
-rw-r--r--Lib/test/test_tarfile.py10
-rw-r--r--Misc/NEWS2
2 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index ee6811884a..75cc0e73d6 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -27,11 +27,8 @@ except ImportError:
def md5sum(data):
return md5(data).hexdigest()
-def path(path):
- return test_support.findfile(path)
-
-TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp")
-tarname = path("testtar.tar")
+TEMPDIR = os.path.abspath(test_support.TESTFN)
+tarname = test_support.findfile("testtar.tar")
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
tmpname = os.path.join(TEMPDIR, "tmp.tar")
@@ -1165,8 +1162,7 @@ class Bz2PartialReadTest(unittest.TestCase):
def test_main():
- if not os.path.exists(TEMPDIR):
- os.mkdir(TEMPDIR)
+ os.makedirs(TEMPDIR)
tests = [
UstarReadTest,
diff --git a/Misc/NEWS b/Misc/NEWS
index ae1be75729..2dd5f6eab3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -77,6 +77,8 @@ Build
Tests
-----
+- Issue #7295: Do not use a hardcoded file name in test_tarfile.
+
- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
primitives such as Lock, RLock, Condition, Event and Semaphore.