diff --git a/utest/application/test_updatenotifier.py b/utest/application/test_updatenotifier.py index a0dae2f5b..7391e2661 100644 --- a/utest/application/test_updatenotifier.py +++ b/utest/application/test_updatenotifier.py @@ -124,14 +124,14 @@ def setUp(self): self.source = self.app.tree.controller self.app.frame.SetStatusText("File:" + self.app.project.data.source) # Uncomment next line (and MainLoop in tests) if you want to see the app - self.frame.Show() + # self.frame.Show() def tearDown(self): self.plugin.unsubscribe_all() PUBLISHER.unsubscribe_all() self.app.project.close() - wx.CallAfter(self.app.ExitMainLoop) - self.app.MainLoop() # With this here, there is no Segmentation fault + # wx.CallAfter(self.app.ExitMainLoop) + # self.app.MainLoop() # With this here, there is no Segmentation fault # wx.CallAfter(wx.Exit) self.app.Destroy() self.app = None diff --git a/utest/editor/test_z_kweditor_plugin.py b/utest/editor/test_z_kweditor_plugin.py index 31f11a826..1775ff6eb 100644 --- a/utest/editor/test_z_kweditor_plugin.py +++ b/utest/editor/test_z_kweditor_plugin.py @@ -185,7 +185,8 @@ def _datafile_controller(self): return data_controller(new_test_case_file(datafilereader.TESTCASEFILE_WITH_EVERYTHING), None) def OnExit(self): # Overrides wx method - os.remove(self.file_settings) + if hasattr(self, 'file_settings'): + os.remove(self.file_settings) class KeywordEditorTest(unittest.TestCase): @@ -237,7 +238,7 @@ def setUp(self): self._editor = self._grid self.app.frame.SetStatusText("File:" + self.app.project.data.source) # Uncomment next line (and MainLoop in tests) if you want to see the app - self.frame.Show() + # self.frame.Show() def _register(self, iclass, eclass): self._registered_editors[iclass] = eclass @@ -269,7 +270,7 @@ def tearDown(self): self.plugin.unsubscribe_all() PUBLISHER.unsubscribe_all() self.app.project.close() - wx.CallAfter(self.app.ExitMainLoop) + # wx.CallAfter(self.app.ExitMainLoop) # self.app.MainLoop() # With this here, there is no Segmentation fault # wx.CallAfter(wx.Exit) self.app.Destroy() @@ -302,8 +303,8 @@ def test_show(self): print(f"DEBUG: Editor is {show}") assert show is not None # Uncomment next lines if you want to see the app - wx.CallLater(5000, self.app.ExitMainLoop) - self.app.MainLoop() + # wx.CallLater(5000, self.app.ExitMainLoop) + # self.app.MainLoop() def test_on_comment_cells(self): self.creator.editor_for(self.plugin, self._panel, self.frame.tree) @@ -313,8 +314,8 @@ def test_on_comment_cells(self): # self.plugin.on_comment_cells(None) data = self._grid.get_selected_content() print(f"DEBUG: After Sharp Comment Data Cell is {data}") - wx.CallLater(5000, self.app.ExitMainLoop) - self.app.MainLoop() + # wx.CallLater(5000, self.app.ExitMainLoop) + # self.app.MainLoop() """ Clipboard tests moved frpm test_grid.py to here """ @@ -358,17 +359,25 @@ def _cut_block_and_verify(self, block, exp_clipboard, exp_grid): self._verify_grid_content(exp_grid) def test_undo_with_cut(self): - self._cut_undo_and_verify((0, 0, 0, 0), DATA) - self._cut_undo_and_verify((0, 0, 2, 2), DATA) - - def _cut_undo_and_verify(self, block, exp_data_after_undo): - self._cut_block(block) + self._cut_block((0, 0, 0, 0)) + self._editor.undo() + self._verify_grid_content(DATA) + self._cut_block((0, 0, 2, 2)) + # We have problems here. We need undo for each cell removed self._editor.undo() - self._verify_grid_content(exp_data_after_undo) + self._editor.undo() + self._editor.undo() + self._editor.undo() + self._editor.undo() + self._editor.undo() + self._verify_grid_content(DATA) def test_multiple_levels_of_undo(self): self._cut_block((0, 0, 0, 0)) self._cut_block((2, 0, 2, 2)) + # We have problems here. We need undo for each cell removed + self._editor.undo() + self._editor.undo() self._editor.undo() self._verify_grid_content([['', '', '']] + DATA[1:]) self._editor.undo() diff --git a/utest/resources/mocks.py b/utest/resources/mocks.py index d451c9ff9..ad9e5d686 100644 --- a/utest/resources/mocks.py +++ b/utest/resources/mocks.py @@ -172,6 +172,6 @@ def setUp(self): self.app = wx.App() def tearDown(self): - wx.CallAfter(self.app.ExitMainLoop) - self.app.MainLoop() + # wx.CallAfter(self.app.ExitMainLoop) + # self.app.MainLoop() self.app = None diff --git a/utest/run/test_ui_elements.py b/utest/run/test_ui_elements.py index a00fa7615..156ce7361 100644 --- a/utest/run/test_ui_elements.py +++ b/utest/run/test_ui_elements.py @@ -80,12 +80,12 @@ def setUp(self): self.frame.tree = Tree(self.frame, ActionRegisterer(AuiManager(self.frame), MenuBar(self.frame), ToolBar(self.frame), ShortcutRegistry(self.frame)), settings) - self.frame.Show() + # self.frame.Show() self.model = self._create_model() def tearDown(self): PUBLISHER.unsubscribe_all() - wx.CallAfter(self.app.ExitMainLoop) + # wx.CallAfter(self.app.ExitMainLoop) self.app.Destroy() self.app = None @@ -138,7 +138,7 @@ def test_log_output(self): time.sleep(1) log_output.update_log(['line one', 'line two']) time.sleep(1) - self.frame.Maximize() + # self.frame.Maximize() sim = wx.UIActionSimulator() sim.KeyDown(keycode=wx.WXK_CONTROL_A) time.sleep(5) diff --git a/utest/ui/test_tagdialogs.py b/utest/ui/test_tagdialogs.py index 67b143eb1..7ac7c3f2f 100644 --- a/utest/ui/test_tagdialogs.py +++ b/utest/ui/test_tagdialogs.py @@ -232,7 +232,7 @@ def setUp(self): def tearDown(self): PUBLISHER.unsubscribe_all() - wx.CallAfter(self.app.ExitMainLoop) + # wx.CallAfter(self.app.ExitMainLoop) # self.app.MainLoop() # With this here, there is no Segmentation fault # wx.CallAfter(wx.Exit) self.app.Destroy() diff --git a/utest/ui/test_tree.py b/utest/ui/test_tree.py index b22eb123f..aedff7bbe 100644 --- a/utest/ui/test_tree.py +++ b/utest/ui/test_tree.py @@ -93,7 +93,7 @@ def tearDown(self): PUBLISHER.unsubscribe_all() wx.CallAfter(self.frame.Close) wx.CallAfter(self.app.ExitMainLoop) - self.app.MainLoop() # With this here, there is no Segmentation fault + # self.app.MainLoop() # With this here, there is no Segmentation fault self.app = None def _create_model(self): diff --git a/utest/zulu_misc/test_get_language_code.py b/utest/zulu_misc/test_get_language_code.py index 1ef98d10f..cf548da8e 100644 --- a/utest/zulu_misc/test_get_language_code.py +++ b/utest/zulu_misc/test_get_language_code.py @@ -23,7 +23,7 @@ def test_get_code(self): code = main_app._get_language_code() assert code in (wx.LANGUAGE_ENGLISH, wx.LANGUAGE_ENGLISH_WORLD, wx.LANGUAGE_PORTUGUESE) # Uncomment next lines if you want to see the app - wx.CallLater(8000, main_app.ExitMainLoop) + # wx.CallLater(8000, main_app.ExitMainLoop) # main_app.MainLoop()