From c331b99dc66f35546289ad17ceb060d0e27532a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 20 Dec 2018 14:04:23 +0100 Subject: [PATCH] Fixed leaking file descriptors in unit tests These weren't any issue in Linux, but Windows doesn't like it when you try to delete a still-opened file. --- tests/abstract_test.py | 2 ++ tests/test_blendfile_loading.py | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/abstract_test.py b/tests/abstract_test.py index 378c38f..a9ac4a7 100644 --- a/tests/abstract_test.py +++ b/tests/abstract_test.py @@ -17,5 +17,7 @@ class AbstractBlendFileTest(unittest.TestCase): self.bf = None def tearDown(self): + if self.bf is not None: + self.bf.close() self.bf = None blendfile.close_all_cached() diff --git a/tests/test_blendfile_loading.py b/tests/test_blendfile_loading.py index 74c65fb..02f36af 100644 --- a/tests/test_blendfile_loading.py +++ b/tests/test_blendfile_loading.py @@ -293,6 +293,7 @@ class BlendFileCacheTest(AbstractBlendFileTest): self.tpath = pathlib.Path(self.tdir.name) def tearDown(self): + super().tearDown() self.tdir.cleanup() def test_open_cached(self):