diff options
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 135973ee4b..3bd2255ab9 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -766,6 +766,13 @@ class TestGC(unittest.TestCase): a = [] self.makecycle(groupby([a]*2, lambda x:x), a) + def test_issue2246(self): + # Issue 2246 -- the _grouper iterator was not included in GC + n = 10 + keyfunc = lambda x: x + for i, j in groupby(xrange(n), key=keyfunc): + keyfunc.__dict__.setdefault('x',[]).append(j) + def test_ifilter(self): a = [] self.makecycle(ifilter(lambda x:True, [a]*2), a) |