From 0cfa58c43a48de7a25c9a26c5aee30f739678bc0 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 13 Apr 2006 04:35:36 +0000 Subject: [PATCH] Remove tests that no longer leak. There is still one leaking generator test --- Lib/test/leakers/test_gen1.py | 19 +++++++++++++++++++ Lib/test/leakers/test_generator_cycle.py | 10 ---------- Lib/test/leakers/test_tee.py | 20 -------------------- 3 files changed, 19 insertions(+), 30 deletions(-) create mode 100644 Lib/test/leakers/test_gen1.py delete mode 100644 Lib/test/leakers/test_generator_cycle.py delete mode 100644 Lib/test/leakers/test_tee.py diff --git a/Lib/test/leakers/test_gen1.py b/Lib/test/leakers/test_gen1.py new file mode 100644 index 00000000000..72f644d3453 --- /dev/null +++ b/Lib/test/leakers/test_gen1.py @@ -0,0 +1,19 @@ +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() diff --git a/Lib/test/leakers/test_generator_cycle.py b/Lib/test/leakers/test_generator_cycle.py deleted file mode 100644 index b0aba4349b9..00000000000 --- a/Lib/test/leakers/test_generator_cycle.py +++ /dev/null @@ -1,10 +0,0 @@ - -# 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() diff --git a/Lib/test/leakers/test_tee.py b/Lib/test/leakers/test_tee.py deleted file mode 100644 index d2b945d1fa5..00000000000 --- a/Lib/test/leakers/test_tee.py +++ /dev/null @@ -1,20 +0,0 @@ - -# 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()