mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-26 07:18:31 +01:00
try to close dvc.state on exit (#5962)
* try to close dvc.state on exit I have a feeling that it is causing the issues with shutil.copytree and some PermissionError during 'init', as we are not closing it between multiple 'main()' calls. But I am not quite sure, and this seems like a good thing to do anyway. * fixup * close dvc on exit * close cache on tests and on init
This commit is contained in:
+5
-1
@@ -154,6 +154,10 @@ class TestDvcFixture(TestDirFixture):
|
||||
super().setUp()
|
||||
self.dvc = DvcRepo.init(self.root_dir, no_scm=True)
|
||||
|
||||
def tearDown(self):
|
||||
self.dvc.close()
|
||||
super().tearDown()
|
||||
|
||||
|
||||
class TestDvcGitFixture(TestGitFixture):
|
||||
def setUp(self):
|
||||
@@ -162,7 +166,7 @@ class TestDvcGitFixture(TestGitFixture):
|
||||
self.dvc.scm.commit("init dvc")
|
||||
|
||||
def tearDown(self):
|
||||
self.dvc.scm.close()
|
||||
self.dvc.close()
|
||||
super().tearDown()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user