Skip to content

Commit

Permalink
Refs #4316 : re-enabled python interface test to try them
Browse files Browse the repository at this point in the history
Hopefully the loop will not get stuck on Mac
  • Loading branch information
Janik Zikovsky committed Dec 19, 2011
1 parent 8917647 commit 1c56ad5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/MantidQt/SliceViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ endif ()
###########################################################################

# python unit tests
#if ( PYUNITTEST_FOUND )
if ( 0 )
if ( PYUNITTEST_FOUND )
#if ( 0 )
pyunittest_add_test ( SliceViewerTest.py ${TEST_PY_FILES} "" )
add_dependencies ( SliceViewerTest.py MantidQt Algorithms )
add_dependencies ( GUITests SliceViewerTest.py )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ def setUp(self):
def tearDown(self):
""" Close the created widget """
# This is crucial! Forces the object to be deleted NOW, not when python exits
# This prevents a segfault in Ubuntu 10.04, and is good practice.
self.svw.deleteLater()
self.svw.show()
# This is required for deleteLater() to do anything (it deletes at the next event loop
# Schedule quit at the next event
Qt.QTimer.singleShot(0, app, Qt.SLOT("closeAllWindows()"))
# This is required for deleteLater() to do anything (it deletes at the next event loop)
app.quitOnLastWindowClosed = True
app.exec_()
return

while app.hasPendingEvents():
app.processEvents()
pass

#==========================================================================
#======================= Basic Tests ======================================
Expand Down

0 comments on commit 1c56ad5

Please sign in to comment.