summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-11 20:55:07 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-11 20:55:07 (GMT)
commit310c9fec1a55bb600daaa062c953faa1f9b2b2f3 (patch)
tree63c540f477b983034f4966c8f1258d7d1b72165a /Lib/test
parentfdd53545a153b8743657656dbc5d3e27b0faebfb (diff)
downloadcpython-310c9fec1a55bb600daaa062c953faa1f9b2b2f3.zip
cpython-310c9fec1a55bb600daaa062c953faa1f9b2b2f3.tar.gz
cpython-310c9fec1a55bb600daaa062c953faa1f9b2b2f3.tar.bz2
Issue #7295: Do not use a hardcoded file name in test_tarfile.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tarfile.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 1240e1a..74a8dac 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")
@@ -1263,8 +1260,7 @@ class Bz2PartialReadTest(unittest.TestCase):
def test_main():
- if not os.path.exists(TEMPDIR):
- os.mkdir(TEMPDIR)
+ os.makedirs(TEMPDIR)
tests = [
UstarReadTest,