diff -r 477508efe4ab Lib/test/test_hashlib.py --- a/Lib/test/test_hashlib.py Sun Jun 03 00:58:36 2012 -0400 +++ b/Lib/test/test_hashlib.py Thu Jun 28 19:38:23 2012 +0200 @@ -108,12 +108,8 @@ _algo.islower()])) def test_unknown_hash(self): - try: - hashlib.new('spam spam spam spam spam') - except ValueError: - pass - else: - self.assertTrue(0 == "hashlib didn't reject bogus hash name") + self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam') + self.assertRaises(TypeError, hashlib.new, 1) def test_get_builtin_constructor(self): get_builtin_constructor = hashlib.__dict__[