Kaydet (Commit) 0cfa58c4 authored tarafından Neal Norwitz's avatar Neal Norwitz

Remove tests that no longer leak. There is still one leaking generator test

üst 5f5a69ba
import gc
# Taken from test_generators
def f():
try:
yield
except GeneratorExit:
yield "foo!"
def inner_leak():
g = f()
g.next()
def leak():
inner_leak()
gc.collect()
gc.collect()
gc.collect()
# This leaks since the introduction of yield-expr and the use of generators
# as coroutines, trunk revision 39239. The cycle-GC doesn't seem to pick up
# the cycle, or decides it can't clean it up.
def leak():
def gen():
while True:
yield g
g = gen()
# Test case taken from test_itertools
# See http://mail.python.org/pipermail/python-dev/2005-November/058339.html
# When this is fixed remember to remove from LEAKY_TESTS in Misc/build.sh.
from itertools import tee
def leak():
def fib():
def yield_identity_forever(g):
while 1:
yield g
def _fib():
for i in yield_identity_forever(head):
yield i
head, tail, result = tee(_fib(), 3)
return result
x = fib()
x.next()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment