[testutils] ensure repo_cache is wiped out before starting a test draft
authorDavid Douard <david.douard@logilab.fr>
Sun, 26 Oct 2014 15:39:10 +0100
changeset 1763 651dcc558568
parent 1762 f3f5638439f2
child 1764 8473295c50b1
[testutils] ensure repo_cache is wiped out before starting a test
testutils.py
--- a/testutils.py	Sun Oct 26 14:43:12 2014 +0100
+++ b/testutils.py	Sun Oct 26 15:39:10 2014 +0100
@@ -12,6 +12,7 @@
 from cubicweb.devtools.testlib import CubicWebTC
 
 from cubes.vcsfile import bridge
+from cubes.vcsfile.hooks import repo_cache_dir
 from cubes.vcsfile.testutils import setup_repos, HGRCMixin
 
 from cubes.narval.testutils import NarvalBaseTC
@@ -194,6 +195,8 @@
     def setUp(self):
         setup_repos(*[join(self.datadir, path) for path in self._repo_path])
         super(ApycotBaseTC, self).setUp()
+        lcache = repo_cache_dir(self.vreg.config)
+        shutil.rmtree(lcache, ignore_errors=True)
         self.refresh()
 
     def tearDown(self):