[pypy-svn] pypy fast-forward: Fix remaining failures in test_generators
amauryfa
commits-noreply at bitbucket.org
Tue Jan 4 19:02:42 CET 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: fast-forward
Changeset: r40391:85cec0318981
Date: 2011-01-04 18:16 +0100
http://bitbucket.org/pypy/pypy/changeset/85cec0318981/
Log: Fix remaining failures in test_generators
diff --git a/lib-python/modified-2.7.0/test/test_generators.py b/lib-python/modified-2.7.0/test/test_generators.py
--- a/lib-python/modified-2.7.0/test/test_generators.py
+++ b/lib-python/modified-2.7.0/test/test_generators.py
@@ -190,7 +190,7 @@
File "<stdin>", line 1, in ?
File "<stdin>", line 2, in g
File "<stdin>", line 2, in f
- ZeroDivisionError: integer division or modulo by zero
+ ZeroDivisionError: integer division by zero
>>> k.next() # and the generator cannot be resumed
Traceback (most recent call last):
File "<stdin>", line 1, in ?
@@ -1757,6 +1757,7 @@
>>> g = f()
>>> g.next()
>>> del g
+>>> gc_collect()
>>> sys.stderr.getvalue().startswith(
... "Exception RuntimeError: 'generator ignored GeneratorExit' in "
... )
@@ -1822,6 +1823,9 @@
references. We add it to the standard suite so the routine refleak-tests
would trigger if it starts being uncleanable again.
+>>> import gc
+>>> def gc_collect(): gc.collect()
+
>>> import itertools
>>> def leak():
... class gen:
@@ -1873,9 +1877,10 @@
...
... l = Leaker()
... del l
+... gc_collect()
... err = sys.stderr.getvalue().strip()
... err.startswith(
-... "Exception RuntimeError: RuntimeError() in <"
+... "Exception RuntimeError: RuntimeError() in "
... )
... err.endswith("> ignored")
... len(err.splitlines())
More information about the Pypy-commit
mailing list