[pypy-commit] pypy default: failing test for hash of record dtypes
bdkearns
noreply at buildbot.pypy.org
Mon Feb 24 02:04:04 CET 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r69317:f33ed1c13f41
Date: 2014-02-23 18:14 -0500
http://bitbucket.org/pypy/pypy/changeset/f33ed1c13f41/
Log: failing test for hash of record dtypes
diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -315,6 +315,22 @@
]:
assert hash(tp(value)) == hash(value)
+ d1 = numpy.dtype([('f0', 'i4'), ('f1', 'i4')])
+ d2 = numpy.dtype([('f0', 'i4'), ('f1', 'i4')])
+ d3 = numpy.dtype([('f0', 'i4'), ('f2', 'i4')])
+ d4 = numpy.dtype([('f0', 'i4'), ('f1', d1)])
+ d5 = numpy.dtype([('f0', 'i4'), ('f1', d2)])
+ d6 = numpy.dtype([('f0', 'i4'), ('f1', d3)])
+ import sys
+ if '__pypy__' not in sys.builtin_module_names:
+ assert hash(d1) == hash(d2)
+ assert hash(d1) != hash(d3)
+ assert hash(d4) == hash(d5)
+ assert hash(d4) != hash(d6)
+ else:
+ for d in [d1, d2, d3, d4, d5, d6]:
+ raises(TypeError, hash, d)
+
def test_pickle(self):
from numpypy import array, dtype
from cPickle import loads, dumps
More information about the pypy-commit
mailing list