summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2012-06-28 23:53:13 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2012-06-28 23:53:13 (GMT)
commit3a3dc17fc9a934682dda76188b367ec261905520 (patch)
tree2f4bb70d1bcfcab511e9ef377425e0736d9e1d43
parentc92448beba60b022624b03068aea53800d0fd923 (diff)
downloadcpython-3a3dc17fc9a934682dda76188b367ec261905520.zip
cpython-3a3dc17fc9a934682dda76188b367ec261905520.tar.gz
cpython-3a3dc17fc9a934682dda76188b367ec261905520.tar.bz2
Port tests from Issue #15219, and verify we don't have a reference leak.
-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__[