[pitivi] tests: Fix isolation by clearing Zoomable._instances



commit 55126860ea236a80310a2e62189e1a8b7ff90d14
Author: Harish Fulara <harish14143 iiitd ac in>
Date:   Fri Mar 2 23:29:33 2018 +0530

    tests: Fix isolation by clearing Zoomable._instances

 tests/common.py      | 6 +++++-
 tests/test_render.py | 3 ---
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index fb2019e8..ea8e091c 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -181,6 +181,10 @@ class TestCase(unittest.TestCase, Loggable):
         del self._tracked
 
     def setUp(self):
+        # TODO: Get rid of Zoomable._instances.
+        from pitivi.utils.timeline import Zoomable
+        del Zoomable._instances[:]
+
         self._num_failures = len(getattr(self._result, 'failures', []))
         self._num_errors = len(getattr(self._result, 'errors', []))
         if detect_leaks:
@@ -293,4 +297,4 @@ def create_test_clip(clip_type):
     clip = clip_type()
     clip.selected = Selected()
     clip.ui = None
-    return clip
\ No newline at end of file
+    return clip
diff --git a/tests/test_render.py b/tests/test_render.py
index a9f887ba..90e2809b 100644
--- a/tests/test_render.py
+++ b/tests/test_render.py
@@ -266,9 +266,6 @@ class TestRender(BaseTestMediaLibrary):
 
     def check_simple_rendering_profile(self, profile_name):
         """Checks that rendering with the specified profile works."""
-        # TODO: Get rid of Zoomable._instances.
-        from pitivi.utils.timeline import Zoomable
-        del Zoomable._instances[:]
         project = self.create_simple_project()
         dialog = self.create_rendering_dialog(project)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]