Skip to content

Commit

Permalink
Stop tests locking up when docs not present and running show help
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Feb 8, 2013
1 parent 208b08e commit dc419f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion safe_qgis/test_impact_functions_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,19 @@ def testRestButton(self):
'is pressed.')
assert expectedTable == realTableReset, msgReset

# This is how you skip a test when using unittest ...
@unittest.skip('Skipping as this test hangs Jenkins if docs not found.')
def test_showHelp(self):
"""Test that help button works"""
# ... and this is how you skip it using nosetests
#pylint: disable=W0101
raise SkipTest("This test hangs Jenkins if docs dir not present.")
myDialog = ImpactFunctionsDoc(PARENT)
myButton = myDialog.myButtonBox.button(QtGui.QDialogButtonBox.Help)
myButton = myDialog.buttonBox.button(QtGui.QDialogButtonBox.Help)
QTest.mouseClick(myButton, QtCore.Qt.LeftButton)
myMessage = 'Help dialog was not created when help button pressed'
assert myDialog.helpDialog is not None, myMessage
#pylint: enable=W0101

if __name__ == "__main__":
suite = unittest.makeSuite(ImpactFunctionsDocTest, 'test')
Expand Down
3 changes: 2 additions & 1 deletion safe_qgis/test_keywords_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def tearDown(self):
clearLayers()

# This is how you skip a test when using unittest ...
@unittest.skip('Skipping as this test hangs Jenkins')
@unittest.skip('Skipping as this test hangs Jenkins if docs arent found.')
def test_showHelp(self):
"""Test that help button works"""
# ... and this is how you skip it using nosetests
Expand All @@ -167,6 +167,7 @@ def test_showHelp(self):
QTest.mouseClick(myButton, QtCore.Qt.LeftButton)
myMessage = 'Help dialog was not created when help button pressed'
assert myDialog.helpDialog is not None, myMessage
#pylint: enable=W0101

def test_on_pbnAdvanced_toggled(self):
"""Test advanced button toggle behaviour works"""
Expand Down

0 comments on commit dc419f3

Please sign in to comment.