[Python-checkins] cpython: Port tests from Issue #15219, and verify we don't have a reference leak.

amaury.forgeotdarc python-checkins at python.org
Fri Jun 29 01:53:43 CEST 2012


http://hg.python.org/cpython/rev/c974c99acdf5
changeset:   77839:c974c99acdf5
parent:      77837:b45f105dbdfb
user:        Amaury Forgeot d'Arc <amauryfa at gmail.com>
date:        Fri Jun 29 01:53:13 2012 +0200
summary:
  Port tests from Issue #15219, and verify we don't have a reference leak.

files:
  Lib/test/test_hashlib.py |  8 ++------
  1 files changed, 2 insertions(+), 6 deletions(-)


diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -113,12 +113,8 @@
                             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__[

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list