A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-July/121067.html below:

[Python-Dev] test_hashlib

[Python-Dev] test_hashlib [Python-Dev] test_hashlibKristjá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:



def test_unknown_hash(self):

    self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')

    self.assertRaises(TypeError, hashlib.new, 1)



but in hashlib.py, there is this code:



except ImportError:

    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?



K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120721/62747a7b/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4