Kristján Valur Jónsson
kristjan at ccpgames.com
Sat Jul 21 23:29:50 CEST 2012
I was hit by this today.
in test_hashlib.py there is this:
self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
self.assertRaises(TypeError, hashlib.new, 1)
but in hashlib.py, there is this code:
pass # no extension module, this hash is unsupported.
raise ValueError('unsupported hash type %s' % name)
The code will raise ValueError when int(1) is passed in, but the unittests expect a TypeError.
So, which is correct?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev