Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r58021:d2423af68642
Date: 2012-10-11 14:33 -0700
http://bitbucket.org/pypy/pypy/changeset/d2423af68642/
Log: o all classes are newstyle now and thus cachable o py3 exception fix
for test_change_methods
diff --git a/pypy/objspace/std/test/test_methodcache.py
b/pypy/objspace/std/test/test_methodcache.py
--- a/pypy/objspace/std/test/test_methodcache.py
+++ b/pypy/objspace/std/test/test_methodcache.py
@@ -27,31 +27,6 @@
assert cache_counter[1] >= 3 # should be (27, 3)
assert sum(cache_counter) == 30
- def test_class_that_cannot_be_cached(self):
- import __pypy__
- class X:
- pass
- class Y(object):
- pass
- class A(Y, X):
- def f(self):
- return 42
-
- class B(object):
- def f(self):
- return 43
- class C(object):
- def f(self):
- return 44
- l = [A(), B(), C()] * 10
- __pypy__.reset_method_cache_counter()
- for i, a in enumerate(l):
- assert a.f() == 42 + i % 3
- cache_counter = __pypy__.method_cache_counter("f")
- assert cache_counter[0] >= 9
- assert cache_counter[1] >= 2 # should be (18, 2)
- assert sum(cache_counter) == 20
-
def test_change_methods(self):
# this test fails because of the following line in typeobject.py:427
# if cached_name is name:
@@ -118,6 +93,7 @@
def test_many_names(self):
import __pypy__
+ laste = None
for j in range(20):
class A(object):
foo = 5
@@ -145,10 +121,10 @@
for name, count in zip(names, names_counters):
assert count == (9, 1), str((name, count))
break
- except AssertionError:
- pass
+ except AssertionError as e:
+ laste = e
else:
- raise
+ raise laste
def test_mutating_bases(self):
class C(object):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit