This commit is contained in:
Florian Bruhin 2014-11-27 22:27:13 +01:00
parent 1f666b2b2e
commit f6dffa74b6
2 changed files with 4 additions and 4 deletions

View File

@ -345,9 +345,11 @@ class RaisesTests(unittest.TestCase):
"""Test raises.""" """Test raises."""
def do_raise(self): def do_raise(self):
"""Helper function which raises an exception."""
raise Exception raise Exception
def do_nothing(self): def do_nothing(self):
"""Helper function which does nothing."""
pass pass
def test_raises_single_exc_true(self): def test_raises_single_exc_true(self):
@ -367,11 +369,11 @@ class RaisesTests(unittest.TestCase):
"""Test raises with multiple exceptions which do not get raised.""" """Test raises with multiple exceptions which do not get raised."""
self.assertFalse(utils.raises((ValueError, TypeError), int, '1')) self.assertFalse(utils.raises((ValueError, TypeError), int, '1'))
def test_no_args(self): def test_no_args_true(self):
"""Test with no args and an exception which gets raised.""" """Test with no args and an exception which gets raised."""
self.assertTrue(utils.raises(Exception, self.do_raise)) self.assertTrue(utils.raises(Exception, self.do_raise))
def test_no_args(self): def test_no_args_false(self):
"""Test with no args and an exception which does not get raised.""" """Test with no args and an exception which does not get raised."""
self.assertFalse(utils.raises(Exception, self.do_nothing)) self.assertFalse(utils.raises(Exception, self.do_nothing))

View File

@ -20,7 +20,6 @@
"""The main statusbar widget.""" """The main statusbar widget."""
import collections import collections
import datetime
from PyQt5.QtCore import pyqtSignal, pyqtSlot, pyqtProperty, Qt, QTime from PyQt5.QtCore import pyqtSignal, pyqtSlot, pyqtProperty, Qt, QTime
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QStackedLayout, QSizePolicy from PyQt5.QtWidgets import QWidget, QHBoxLayout, QStackedLayout, QSizePolicy
@ -317,7 +316,6 @@ class StatusBar(QWidget):
""" """
log.statusbar.debug("Displaying text: {} (error={})".format( log.statusbar.debug("Displaying text: {} (error={})".format(
text, error)) text, error))
now = datetime.datetime.now()
mindelta = config.get('ui', 'message-timeout') mindelta = config.get('ui', 'message-timeout')
if self._stopwatch.isNull(): if self._stopwatch.isNull():
delta = None delta = None