diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-11 20:59:38 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-11 20:59:38 (GMT) |
commit | 941ee888e26a2a2a412cccf6ba3f025c89995e81 (patch) | |
tree | 093a3c2c0165e4da461e632bda016a5578bed87b /Lib/test/test_tarfile.py | |
parent | cf4cabbe2a467cc0b17e69c10fbc0945acdb1706 (diff) | |
download | cpython-941ee888e26a2a2a412cccf6ba3f025c89995e81.zip cpython-941ee888e26a2a2a412cccf6ba3f025c89995e81.tar.gz cpython-941ee888e26a2a2a412cccf6ba3f025c89995e81.tar.bz2 |
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.
........
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index e916879..551d098 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -26,11 +26,8 @@ except ImportError: def md5sum(data): return md5(data).hexdigest() -def path(path): - return support.findfile(path) - -TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp") -tarname = path("testtar.tar") +TEMPDIR = os.path.abspath(support.TESTFN) +tarname = 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") @@ -1244,8 +1241,7 @@ class Bz2PartialReadTest(unittest.TestCase): def test_main(): - if not os.path.exists(TEMPDIR): - os.mkdir(TEMPDIR) + os.makedirs(TEMPDIR) tests = [ UstarReadTest, |