make sure the repo object will be collected before the repo is removed

This commit is contained in:
Matthias Bartelmeß 2016-07-22 10:46:11 +02:00
parent ffc514fa24
commit cdd57b2c0f

@ -35,6 +35,7 @@ import tarfile
import tempfile
import unittest
import hashlib
import gc
import pygit2
@ -94,6 +95,7 @@ class NoRepoTestCase(unittest.TestCase):
def tearDown(self):
del self.repo
gc.collect()
rmtree(self._temp_dir)
def assertRaisesAssign(self, exc_class, instance, name, value):
@ -132,8 +134,8 @@ class AutoRepoTestCase(NoRepoTestCase):
self.repo = pygit2.Repository(self.repo_path)
def tearDown(self):
self.repo_ctxtmgr.__exit__(None, None, None)
super(AutoRepoTestCase, self).tearDown()
self.repo_ctxtmgr.__exit__(None, None, None)
class BareRepoTestCase(AutoRepoTestCase):