# HG changeset patch # User Patrick Mezard # Date 1334938062 -7200 # Node ID c58213aaf7c802f951b80c6f0a604a947be2dda1 # Parent a279b5838aaf4ddcdb18aa09dbe573e68c339a02 test_svnwrap: use test_util.rmtree() (or fix it) diff --git a/tests/test_svnwrap.py b/tests/test_svnwrap.py --- a/tests/test_svnwrap.py +++ b/tests/test_svnwrap.py @@ -3,21 +3,11 @@ import test_util import imp import os import subprocess -import shutil import tempfile import unittest from hgsubversion import svnwrap -import os -import stat -def force_rm(path): - os.chmod( - path, - os.stat(path).st_mode | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH - ) - os.remove(path) - class TestBasicRepoLayout(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp('svnwrap_test') @@ -35,8 +25,7 @@ class TestBasicRepoLayout(unittest.TestC def tearDown(self): del self.repo - shutil.rmtree(self.tmpdir, onerror=lambda func, path, e: force_rm(path)) - + test_util.rmtree(self.tmpdir) def test_num_revs(self): revs = list(self.repo.revisions())