mailr27494 - /trunk/test_suite/gui_tests/base_classes.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 03, 2015 - 18:37:
Author: bugman
Date: Tue Feb  3 18:37:24 2015
New Revision: 27494

URL: http://svn.gna.org/viewcvs/relax?rev=27494&view=rev
Log:
Removed the wx.CallAfter() call in the GUI tests tearDown() method.

This was used to call the clean_up_windows() method.  However the value of 
wx.Thread_IsMain() shows
that the tearDown() method executes in the main GUI thread.  Therefore the 
wx.CallAfter() call for
avoiding racing conditions is not needed.


Modified:
    trunk/test_suite/gui_tests/base_classes.py

Modified: trunk/test_suite/gui_tests/base_classes.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/gui_tests/base_classes.py?rev=27494&r1=27493&r2=27494&view=diff
==============================================================================
--- trunk/test_suite/gui_tests/base_classes.py  (original)
+++ trunk/test_suite/gui_tests/base_classes.py  Tue Feb  3 18:37:24 2015
@@ -159,6 +159,15 @@
 
     def clean_up_windows(self):
         """Kill all windows."""
+
+        # Close all windows to unregister the observer objects.
+        if hasattr(self.app.gui, 'pipe_editor'):
+            self.app.gui.pipe_editor.Close()
+        if hasattr(self.app.gui, 'results_viewer'):
+            self.app.gui.results_viewer.Close()
+        if hasattr(self.app.gui, 'relax_prompt'):
+            self.app.gui.relax_prompt.Close()
+        wx.Yield()
 
         # Destroy all user function windows to save memory (specifically to 
avoid the 10,000 USER Object limit in MS Windows).
         for name in uf_store:
@@ -292,20 +301,8 @@
         # Get the wx app.
         self.app = wx.GetApp()
 
-        # Close all windows to unregister the observer objects.
-        if hasattr(self.app.gui, 'pipe_editor'):
-            self.app.gui.pipe_editor.Close()
-        if hasattr(self.app.gui, 'results_viewer'):
-            self.app.gui.results_viewer.Close()
-        if hasattr(self.app.gui, 'relax_prompt'):
-            self.app.gui.relax_prompt.Close()
-        wx.Yield()
-
         # Kill all windows.
-        wx.CallAfter(self.clean_up_windows)
-
-        # Flush all wx events again to allow the reset event to propagate 
throughout the GUI and the execution lock to be released before the next test 
starts.
-        wx.Yield()
+        self.clean_up_windows()
 
         # Print out a list of all living windows to help ensure that custom 
Close() and Destroy() methods are cleaning up all objects.
         print("\n\nList of all living GUI elements - this must only include 
the main GUI window and the relax controller:")




Related Messages


Powered by MHonArc, Updated Tue Feb 03 19:00:02 2015