Use assertRaises to check for the NameError

Also corrected spelling of a word.
This commit is contained in:
Mìcheal A Colquhoun 2017-03-04 11:42:24 +11:00 committed by Nick Hall
parent 0cba44146a
commit 539330309b

View File

@ -65,10 +65,9 @@ class TestCallback(unittest.TestCase):
def borked(i):
"""
this intentionally raises a NameError exception
FIXME: could use an explanation
or perhaps some explicit Try/Except code
This intentionally raises a NameError exception
"""
with self.assertRaises(NameError):
rubish.append(i)
t = TestSignals()
@ -87,7 +86,7 @@ class TestCallback(unittest.TestCase):
log = _log
self.assertEqual(len(rl), 1, "No signal emitted")
self.assertEqual(rl[0], 1, "Wrong argument recieved")
self.assertEqual(rl[0], 1, "Wrong argument received")
def test_disconnect(self):