diff --git a/tests/__init__.py b/tests/__init__.py index f4ba1a5..1e8d09c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -73,6 +73,7 @@ class Modeltests(unittest.TestCase): unittest.TestCase.__init__(self, method_name) self.session = None self.path = tempfile.mkdtemp(prefix='progit-tests') + self.gitrepo = None # pylint: disable=C0103 def setUp(self): @@ -129,6 +130,10 @@ class Modeltests(unittest.TestCase): db_name = DB_PATH.rsplit('/', 1)[1] requests.get('%s/clean/%s' % (FAITOUT_URL, db_name)) + # Clear eventual git repo + if self.gitrepo and os.path.exists(self.gitrepo): + shutil.rmtree(self.gitrepo) + class FakeGroup(object): """ Fake object used to make the FakeUser object closer to the