Author: bugman
Date: Tue Feb 3 09:20:10 2015
New Revision: 27445
URL: http://svn.gna.org/viewcvs/relax?rev=27445&view=rev
Log:
Large improvement for the GUI test tearDown() clean up method, fixing the tests
on wxPython 2.8.
The user function window destruction has been shifted into a new
clean_up_windows() method which is
executed via wx.CallAfter() to avoid racing conditions. In addition, the spin
viewer window is
destroyed between tests.
The spin viewer window change allows the GUI tests to pass on wxPython 2.8
again. This also allows
the GUI tests to progress much further on Mac OS X systems before they crash
again for some other
reason. This could simply be hiding a problem in the spin viewer window.
However it is likely to
be a racing problem only triggered by the super fast speed of the GUI tests and
a normal user would
never be able to operate the GUI on the millisecond timescale and hence may
never see it.
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=27445&r1=27444&r2=27445&view=diff
==============================================================================
--- trunk/test_suite/gui_tests/base_classes.py (original)
+++ trunk/test_suite/gui_tests/base_classes.py Tue Feb 3 09:20:10 2015
@@ -149,6 +149,24 @@
# No exception.
except queue.Empty:
pass
+
+
+ def clean_up_windows(self):
+ """Kill all windows."""
+
+ # 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:
+ if hasattr(uf_store[name], 'page') and uf_store[name].page != None:
+ uf_store[name].page.Destroy()
+ del uf_store[name].page
+ if uf_store[name].wizard != None:
+ uf_store[name].wizard.Close()
+ uf_store[name].wizard = None
+
+ # Kill the spin viewer window.
+ if hasattr(self.app.gui, 'spin_viewer'):
+ self.app.gui.spin_viewer.Destroy()
+ del self.app.gui.spin_viewer
def new_analysis_wizard(self, analysis_type=None, analysis_name=None,
pipe_name=None, pipe_bundle=None):
@@ -255,14 +273,11 @@
# Reset relax.
reset()
- # 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:
- if hasattr(uf_store[name], 'page') and uf_store[name].page != None:
- uf_store[name].page.Destroy()
- del uf_store[name].page
- if uf_store[name].wizard != None:
- uf_store[name].wizard.Close()
- uf_store[name].wizard = None
+ # Get the wx app.
+ self.app = wx.GetApp()
+
+ # 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()
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits