make sure the repo object will be collected before the repo is removed
This commit is contained in:
parent
ffc514fa24
commit
cdd57b2c0f
@ -35,6 +35,7 @@ import tarfile
|
|||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import gc
|
||||||
|
|
||||||
import pygit2
|
import pygit2
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ class NoRepoTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
del self.repo
|
del self.repo
|
||||||
|
gc.collect()
|
||||||
rmtree(self._temp_dir)
|
rmtree(self._temp_dir)
|
||||||
|
|
||||||
def assertRaisesAssign(self, exc_class, instance, name, value):
|
def assertRaisesAssign(self, exc_class, instance, name, value):
|
||||||
@ -132,8 +134,8 @@ class AutoRepoTestCase(NoRepoTestCase):
|
|||||||
self.repo = pygit2.Repository(self.repo_path)
|
self.repo = pygit2.Repository(self.repo_path)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.repo_ctxtmgr.__exit__(None, None, None)
|
|
||||||
super(AutoRepoTestCase, self).tearDown()
|
super(AutoRepoTestCase, self).tearDown()
|
||||||
|
self.repo_ctxtmgr.__exit__(None, None, None)
|
||||||
|
|
||||||
|
|
||||||
class BareRepoTestCase(AutoRepoTestCase):
|
class BareRepoTestCase(AutoRepoTestCase):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user