[pypy-commit] pypy py3.5: Add passing test
rlamy
pypy.commits at gmail.com
Sat Feb 25 09:48:37 EST 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r90353:855aac3ae3fc
Date: 2017-02-25 14:48 +0000
http://bitbucket.org/pypy/pypy/changeset/855aac3ae3fc/
Log: Add passing test
diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -229,6 +229,13 @@
assert d[cmpr] == 72
assert d[3] == 72
+ def test_hash_inheritance(self):
+ foo = self.import_module("foo")
+ assert hash(foo.UnicodeSubtype(u'xyz')) == hash(u'xyz')
+ assert foo.UnicodeSubtype.__hash__ is str.__hash__
+ assert hash(foo.UnicodeSubtype3(u'xyz')) == hash(u'xyz')
+ assert foo.UnicodeSubtype3.__hash__ is str.__hash__
+
def test_descriptor(self):
module = self.import_module("foo")
prop = module.Property()
@@ -1139,8 +1146,8 @@
((PyHeapTypeObject*)Base2)->ht_qualname = dummyname;
((PyHeapTypeObject*)Base12)->ht_qualname = dummyname;
}
- #endif
- #endif
+ #endif
+ #endif
Base1->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE;
Base2->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE;
Base12->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE;
More information about the pypy-commit
mailing list