Merged revisions 76219 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r76219 | antoine.pitrou | 2009-11-11 21:59:38 +0100 (mer., 11 nov. 2009) | 9 lines

  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.
  ........
................
This commit is contained in:
Antoine Pitrou 2009-11-11 21:01:33 +00:00
parent ca5130cba3
commit b78ba6b3d0
2 changed files with 5 additions and 7 deletions

View File

@ -26,11 +26,8 @@ except ImportError:
def md5sum(data): def md5sum(data):
return md5(data).hexdigest() return md5(data).hexdigest()
def path(path): TEMPDIR = os.path.abspath(support.TESTFN)
return support.findfile(path) tarname = 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")
@ -1146,8 +1143,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,

View File

@ -144,6 +144,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.