Port tests from Issue #15219, and verify we don't have a reference leak.

This commit is contained in:
Amaury Forgeot d'Arc 2012-06-29 01:53:13 +02:00
parent c92448beba
commit 3a3dc17fc9
1 changed files with 2 additions and 6 deletions

View File

@ -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__[