From 48425e230f09cd066ab118b3acbb0b1682f312ab Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 10 Nov 2019 10:10:22 -0800 Subject: [PATCH] Before running tests delete test common data dir, and after running tests stop trying to delete the tmpdir because it gets deteleted automatically --- tests2/gui_base_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests2/gui_base_test.py b/tests2/gui_base_test.py index f85c09bf..2b3cdf89 100644 --- a/tests2/gui_base_test.py +++ b/tests2/gui_base_test.py @@ -27,6 +27,10 @@ class GuiBaseTest(unittest.TestCase): @classmethod def setUpClass(cls): common = Common(verbose=True) + + # Delete any old test data that might exist + shutil.rmtree(common.build_data_dir(), ignore_errors=True) + qtapp = Application(common) common.gui = GuiCommon(common, qtapp, local_only=True) cls.gui = MainWindow(common, filenames=None) @@ -59,10 +63,6 @@ class GuiBaseTest(unittest.TestCase): cls.gui.close() cls.gui.cleanup() - try: - shutil.rmtree(cls.tmpdir.name, ignore_errors=True) - except: - pass # Shared test methods