Kaydet (Commit) 310c9fec authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Issue #7295: Do not use a hardcoded file name in test_tarfile.

üst fdd53545
...@@ -27,11 +27,8 @@ except ImportError: ...@@ -27,11 +27,8 @@ except ImportError:
def md5sum(data): def md5sum(data):
return md5(data).hexdigest() return md5(data).hexdigest()
def path(path): TEMPDIR = os.path.abspath(test_support.TESTFN)
return test_support.findfile(path) tarname = test_support.findfile("testtar.tar")
TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp")
tarname = path("testtar.tar")
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz") gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2") bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
tmpname = os.path.join(TEMPDIR, "tmp.tar") tmpname = os.path.join(TEMPDIR, "tmp.tar")
...@@ -1263,8 +1260,7 @@ class Bz2PartialReadTest(unittest.TestCase): ...@@ -1263,8 +1260,7 @@ class Bz2PartialReadTest(unittest.TestCase):
def test_main(): def test_main():
if not os.path.exists(TEMPDIR): os.makedirs(TEMPDIR)
os.mkdir(TEMPDIR)
tests = [ tests = [
UstarReadTest, UstarReadTest,
......
...@@ -1559,6 +1559,8 @@ Extension Modules ...@@ -1559,6 +1559,8 @@ Extension Modules
Tests Tests
----- -----
- Issue #7295: Do not use a hardcoded file name in test_tarfile.
- Issue #7270: Add some dedicated unit tests for multi-thread synchronization - Issue #7270: Add some dedicated unit tests for multi-thread synchronization
primitives such as Lock, RLock, Condition, Event and Semaphore. primitives such as Lock, RLock, Condition, Event and Semaphore.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment