summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hash.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-241-1/+1
| | | | collections. (#1263)
* Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-1/+1
| | | | Patch by Christie Wilson.
* Issue #20363. Fixed BytesWarning triggerred by test suite.Serhiy Storchaka2014-02-061-1/+1
|\ | | | | | | Patch by Berker Peksag.
| * Issue #20363. Fixed BytesWarning triggerred by test suite.Serhiy Storchaka2014-02-061-1/+1
| | | | | | | | Patch by Berker Peksag.
* | Fix test_hash on "SPARC Solaris 10 (cc%2C 64b) [SB] 3.x" buildbotVictor Stinner2014-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | I picked the value from the error message: ====================================================================== FAIL: test_ucs2_string (test.test_hash.StrHashRandomizationTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/test_hash.py", line 292, in test_ucs2_string self.assertEqual(self.get_hash(self.repr_ucs2, seed=42), h) AssertionError: -3927695501187247084 != None
* | test_hash: Fix a BytesWarning in get_hash_command()Victor Stinner2014-02-011-1/+1
| |
* | Issue #20162: test_hash_distribution() uses subTest() to mention the prefix inVictor Stinner2014-01-071-9/+10
| | | | | | | | the error message.
* | update siphash24 test valuesChristian Heimes2013-11-201-11/+7
| |
* | ssue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.Christian Heimes2013-11-201-15/+135
|/ | | | Python now uses SipHash24 on all major platforms.
* #17304: test_hash now works with unittest test discovery. Patch by Zachary ↵Ezio Melotti2013-02-271-21/+11
| | | | Ware.
* Add a test for hashing of unaligned memory buffers (from issue #16427).Antoine Pitrou2012-11-111-0/+10
|
* Fix (presumably) test_hash under big-endian systems (PPC).Antoine Pitrou2012-02-221-2/+8
|
* enable hash randomization by defaultBenjamin Peterson2012-02-211-2/+2
|
* Actually run the new tests.Antoine Pitrou2012-02-211-0/+1
|
* Add a test that memoryviews have hash randomization enabled.Antoine Pitrou2012-02-211-0/+6
|
* Merge 3.2: Issue #13703 plus some related test suite fixes.Georg Brandl2012-02-201-2/+90
|\
| * Merge from 3.1: Issue #13703: add a way to randomize the hash values of ↵Georg Brandl2012-02-201-2/+90
| |\ | | | | | | | | | | | | | | | | | | | | | | | | basic types (str, bytes, datetime) in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated. The environment variable PYTHONHASHSEED and the new command line flag -R control this behavior.
| | * Issue #13703: add a way to randomize the hash values of basic types (str, ↵Georg Brandl2012-02-201-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | bytes, datetime) in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated. The environment variable PYTHONHASHSEED and the new command line flag -R control this behavior.
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
* | | Issue #13201: equality for range objects is now based on equality of the ↵Mark Dickinson2011-10-231-2/+1
|/ / | | | | | | underlying sequences. Thanks Sven Marnach for the patch.
* | Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* | convert old fail* assertions to assert*Benjamin Peterson2009-06-301-1/+1
|/
* long -> intGuilherme Polo2009-02-071-1/+1
|
* Merged revisions ↵Benjamin Peterson2009-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 69129-69131,69139-69140,69143,69154-69159,69169,69288-69289,69293,69297-69301,69348 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r69129 | benjamin.peterson | 2009-01-30 19:42:55 -0600 (Fri, 30 Jan 2009) | 1 line check the errno in bad fd cases ........ r69130 | andrew.kuchling | 2009-01-30 20:50:09 -0600 (Fri, 30 Jan 2009) | 1 line Add a section ........ r69131 | andrew.kuchling | 2009-01-30 21:26:02 -0600 (Fri, 30 Jan 2009) | 1 line Text edits and markup fixes ........ r69139 | mark.dickinson | 2009-01-31 10:44:04 -0600 (Sat, 31 Jan 2009) | 2 lines Add an extra test for long <-> float hash equivalence. ........ r69140 | benjamin.peterson | 2009-01-31 10:52:03 -0600 (Sat, 31 Jan 2009) | 1 line PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 ........ r69143 | benjamin.peterson | 2009-01-31 15:00:10 -0600 (Sat, 31 Jan 2009) | 1 line I believe the intention here was to avoid a global lookup ........ r69154 | benjamin.peterson | 2009-01-31 16:33:02 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation in comment ........ r69155 | david.goodger | 2009-01-31 16:53:46 -0600 (Sat, 31 Jan 2009) | 1 line markup fix ........ r69156 | gregory.p.smith | 2009-01-31 16:57:30 -0600 (Sat, 31 Jan 2009) | 4 lines - Issue #5104: The socket module now raises OverflowError when 16-bit port and protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). ........ r69157 | benjamin.peterson | 2009-01-31 17:43:25 -0600 (Sat, 31 Jan 2009) | 1 line add explanatory comment ........ r69158 | benjamin.peterson | 2009-01-31 17:54:38 -0600 (Sat, 31 Jan 2009) | 1 line more flags which only work for function blocks ........ r69159 | gregory.p.smith | 2009-01-31 18:16:01 -0600 (Sat, 31 Jan 2009) | 2 lines Update doc wording as suggested in issue4903. ........ r69169 | guilherme.polo | 2009-01-31 20:56:16 -0600 (Sat, 31 Jan 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69288 | georg.brandl | 2009-02-05 04:30:57 -0600 (Thu, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 04:37:07 -0600 (Thu, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 04:59:28 -0600 (Thu, 05 Feb 2009) | 1 line #5059: fix example. ........ r69297 | georg.brandl | 2009-02-05 05:32:18 -0600 (Thu, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 05:33:21 -0600 (Thu, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 05:35:28 -0600 (Thu, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 05:38:23 -0600 (Thu, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 05:40:35 -0600 (Thu, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........
* Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ fromMark Dickinson2009-01-271-6/+0
| | | | the standard library and tests.
* Recorded merge of revisions 68051 via svnmerge fromNick Coghlan2008-12-301-1/+22
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68051 | nick.coghlan | 2008-12-30 11:18:48 +1000 (Tue, 30 Dec 2008) | 1 line Issue #4701: implicitly call PyType_Ready from PyObject_Hash ........
* remove some more references to __cmp__ #1717Benjamin Peterson2008-10-161-1/+0
|
* Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash ↵Nick Coghlan2008-07-151-1/+69
| | | | level indicator that the default hash implementation has not been inherited
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|
* Merged revisions 58203-58210 via svnmerge fromThomas Wouters2007-09-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r58204 | georg.brandl | 2007-09-19 08:37:19 +0200 (Wed, 19 Sep 2007) | 2 lines Fix #1169: remove docstrings in functions for -OO. ........ r58206 | sean.reifschneider | 2007-09-19 09:52:56 +0200 (Wed, 19 Sep 2007) | 2 lines issue1177: Ported Facundo's from urllib2 to urllib, accepting 2xx responses. ........ r58207 | facundo.batista | 2007-09-19 16:02:03 +0200 (Wed, 19 Sep 2007) | 3 lines Annotated the correction to urllib.py, issue #1177 ........ r58208 | facundo.batista | 2007-09-19 17:10:06 +0200 (Wed, 19 Sep 2007) | 7 lines Issue #1772851. Alters long.__hash__ from being *almost* completely predictable to being completely predictable. The value of hash(n) is unchanged for any n that's small enough to be representable as an int, and also unchanged for the vast majority of long integers n of reasonable size. ........ r58209 | thomas.wouters | 2007-09-19 19:27:29 +0200 (Wed, 19 Sep 2007) | 4 lines Fix obvious typo in threaded test. ........ r58210 | thomas.wouters | 2007-09-19 19:27:43 +0200 (Wed, 19 Sep 2007) | 4 lines Whitespace cleanup. ........
* Merged revisions 56125-56153 via svnmerge fromGuido van Rossum2007-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r56127 | georg.brandl | 2007-06-30 09:32:49 +0200 (Sat, 30 Jun 2007) | 2 lines Fix a place where floor division would be in order. ........ r56135 | guido.van.rossum | 2007-07-01 06:13:54 +0200 (Sun, 01 Jul 2007) | 28 lines Make map() and filter() identical to itertools.imap() and .ifilter(), respectively. I fixed two bootstrap issues, due to the dynamic import of itertools: 1. Starting python requires that map() and filter() are not used until site.py has added build/lib.<arch> to sys.path. 2. Building python requires that setup.py and distutils and everything they use is free of map() and filter() calls. Beyond this, I only fixed the tests in test_builtin.py. Others, please help fixing the remaining tests that are now broken! The fixes are usually simple: a. map(None, X) -> list(X) b. map(F, X) -> list(map(F, X)) c. map(lambda x: F(x), X) -> [F(x) for x in X] d. filter(F, X) -> list(filter(F, X)) e. filter(lambda x: P(x), X) -> [x for x in X if P(x)] Someone, please also contribute a fixer for 2to3 to do this. It can leave map()/filter() calls alone that are already inside a list() or sorted() call or for-loop. Only in rare cases have I seen code that depends on map() of lists of different lengths going to the end of the longest, or on filter() of a string or tuple returning an object of the same type; these will need more thought to fix. ........ r56136 | guido.van.rossum | 2007-07-01 06:22:01 +0200 (Sun, 01 Jul 2007) | 3 lines Make it so that test_decimal fails instead of hangs, to help automated test runners. ........ r56139 | georg.brandl | 2007-07-01 18:20:58 +0200 (Sun, 01 Jul 2007) | 2 lines Fix a few test cases after the map->imap change. ........ r56142 | neal.norwitz | 2007-07-02 06:38:12 +0200 (Mon, 02 Jul 2007) | 1 line Get a bunch more tests passing after converting map/filter to return iterators. ........ r56147 | guido.van.rossum | 2007-07-02 15:32:02 +0200 (Mon, 02 Jul 2007) | 4 lines Fix the remaining failing unit tests (at least on OSX). Also tweaked urllib2 so it doesn't raise socket.gaierror when all network interfaces are turned off. ........
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-3/+3
| | | | (Rough first cut.)
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-1/+1
| | | | From SF patch #852334.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Change the PyUnit-based tests to use the test_main() approach. ThisFred Drake2001-09-201-1/+6
| | | | | allows using the tests with unittest.py as a script. The tests will still run when run as a script themselves.
* Update a comment.Fred Drake2001-05-181-2/+2
|
* Simple conversion to PyUnit.Fred Drake2001-05-181-11/+19
|
* Make reindent.py happy (convert everything to 4-space indents!).Fred Drake2000-10-231-9/+6
|
* This patch addresses two main issues: (1) There exist some non-fatalFred Drake2000-06-291-0/+26
errors in some of the hash algorithms. For exmaple, in float_hash and complex_hash a certain part of the value is not included in the hash calculation. See Tim's, Guido's, and my discussion of this on python-dev in May under the title "fix float_hash and complex_hash for 64-bit *nix" (2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are universally not correct on Win64 (they assume that sizeof(long) == sizeof(void*)) As well, this patch significantly cleans up the hash code. It adds the two function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine are changed to use. These help maintain the hash function invariant: (a==b) => (hash(a)==hash(b))) I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this for some cases.