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/121069.html below:

[Python-Dev] test_hashlib

[Python-Dev] test_hashlib [Python-Dev] test_hashlibAmaury Forgeot d'Arc amauryfa at gmail.com
Sun Jul 22 00:56:55 CEST 2012
2012/7/21 Antoine Pitrou <solipsis at pitrou.net>:
> Kristján Valur Jónsson <kristjan at ccpgames.com> wrote:
>>
>> The code will raise ValueError when int(1) is passed in, but the
>> unittests expect a TypeError.
>
> Well, if test_hashlib passes, surely your analysis is wrong, no?

In the normal case, yes:

>>> import hashlib
>>> hashlib.new(1)
TypeError: name must be a string

But if the _hashlib extension module is not available, the python
version is used and ValueError is raised:

>>> import sys
>>> sys.modules['_hashlib'] = None
>>> import hashlib
>>> hashlib.new(1)
ValueError: unsupported hash type 1

-- 
Amaury Forgeot d'Arc
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