Commit 2bb246ac authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 76103 via svnmerge from

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

................
  r76103 | antoine.pitrou | 2009-11-04 01:57:15 +0100 (mer., 04 nov. 2009) | 9 lines

  Merged revisions 76101 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r76101 | antoine.pitrou | 2009-11-04 01:50:26 +0100 (mer., 04 nov. 2009) | 3 lines

    Make test_shutil clean up after itself
  ........
................
parent d6fcd562
......@@ -118,7 +118,7 @@ class TestShutil(unittest.TestCase):
if os.path.exists(path):
os.remove(path)
for path in (src_dir,
os.path.abspath(os.path.join(dst_dir, os.path.pardir))
os.path.dirname(dst_dir)
):
if os.path.exists(path):
shutil.rmtree(path)
......@@ -140,6 +140,7 @@ class TestShutil(unittest.TestCase):
join = os.path.join
exists = os.path.exists
src_dir = tempfile.mkdtemp()
try:
dst_dir = join(tempfile.mkdtemp(), 'destination')
write_data(join(src_dir, 'test.txt'), '123')
write_data(join(src_dir, 'test.tmp'), '123')
......@@ -199,6 +200,9 @@ class TestShutil(unittest.TestCase):
finally:
if os.path.exists(dst_dir):
shutil.rmtree(dst_dir)
finally:
shutil.rmtree(src_dir)
shutil.rmtree(os.path.dirname(dst_dir))
if hasattr(os, "symlink"):
def test_dont_copy_file_onto_link_to_itself(self):
......
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