Author: Alex Gaynor <[email protected]>
Branch: detect-immutable-fields
Changeset: r68905:87ce7e7c00c5
Date: 2014-01-24 09:08 -0600
http://bitbucket.org/pypy/pypy/changeset/87ce7e7c00c5/

Log:    Make teh test pass

diff --git a/pypy/objspace/std/test/test_mapdict.py 
b/pypy/objspace/std/test/test_mapdict.py
--- a/pypy/objspace/std/test/test_mapdict.py
+++ b/pypy/objspace/std/test/test_mapdict.py
@@ -107,7 +107,7 @@
     assert obj2.getdictvalue(space, "b") == 60
     assert obj2.map is obj.map
 
-def test_attr_immutability():
+def test_attr_immutability(monkeypatch):
     cls = Class()
     obj = cls.instantiate()
     obj.setdictvalue(space, "a", 10)
@@ -119,12 +119,13 @@
 
     indices = []
 
-    def _pure_mapdict_read_storage(obj, index):
-        assert index == 0
-        indices.append(index)
-        return obj._mapdict_read_storage(obj, index)
+    def _pure_mapdict_read_storage(obj, storageindex):
+        assert storageindex == 0
+        indices.append(storageindex)
+        return obj._mapdict_read_storage(storageindex)
 
     obj.map._pure_mapdict_read_storage = _pure_mapdict_read_storage
+    monkeypatch.setattr(jit, "isconstant", lambda c: True)
 
     assert obj.getdictvalue(space, "a") == 10
     assert obj.getdictvalue(space, "b") == 30
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to