[pypy-svn] r56165 - pypy/dist/pypy/module/_weakref/test
arigo at codespeak.net
arigo at codespeak.net
Sat Jun 28 19:54:07 CEST 2008
Author: arigo
Date: Sat Jun 28 19:54:07 2008
New Revision: 56165
Modified:
pypy/dist/pypy/module/_weakref/test/test_weakref.py
Log:
Fix this test for "pypy-c py.test -A".
Modified: pypy/dist/pypy/module/_weakref/test/test_weakref.py
==============================================================================
--- pypy/dist/pypy/module/_weakref/test/test_weakref.py (original)
+++ pypy/dist/pypy/module/_weakref/test/test_weakref.py Sat Jun 28 19:54:07 2008
@@ -363,7 +363,9 @@
def test_repr(self):
import _weakref, gc
for kind in ('ref', 'proxy'):
- def foobaz(): pass
+ def foobaz():
+ "A random function not returning None."
+ return 42
w = getattr(_weakref, kind)(foobaz)
s = repr(w)
print s
@@ -377,10 +379,10 @@
try:
for i in range(10):
if w() is None:
- break
+ break # only reachable if kind == 'ref'
gc.collect()
except ReferenceError:
- pass
+ pass # only reachable if kind == 'proxy'
s = repr(w)
print s
assert "dead" in s
More information about the Pypy-commit
mailing list