Before running tests delete test common data dir, and after running tests stop trying to delete the tmpdir because it gets deteleted automatically

This commit is contained in:
Micah Lee 2019-11-10 10:10:22 -08:00
parent 35880c0070
commit 48425e230f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -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