summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hashlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r--Lib/test/test_hashlib.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index ce8175a..d2ef9d1 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -113,12 +113,8 @@ class HashLibTestCase(unittest.TestCase):
issubset(hashlib.algorithms_available))
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__[