From: Brett Cannon Date: Thu, 22 Feb 2007 04:45:13 +0000 (+0000) Subject: Fix test_iterlen by returning the iterator of dict views. Problem is that X-Git-Tag: v3.0a1~1206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb6b0eec297d929aa5961f0f6a957b47fd945006;p=python Fix test_iterlen by returning the iterator of dict views. Problem is that iteritems and itervalues' previous object were both an iterator *and* and iterable. The tests expected an iterator but were given an iterable. Should the 2to3 conversion for iter(values|items|keys) change the code to ``iter(dict.keys())`` to be more compatible? --- diff --git a/BROKEN b/BROKEN index 7515740db7..c9d7a04a41 100644 --- a/BROKEN +++ b/BROKEN @@ -1,2 +1,2 @@ test_bsddb test_bsddb3 test_compile test_dumbdbm - test_importhooks test_iter test_iterlen + test_importhooks test_iter diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py index e9a6a68816..8ff1d6bb17 100644 --- a/Lib/test/test_iterlen.py +++ b/Lib/test/test_iterlen.py @@ -139,14 +139,14 @@ class TestDictItems(TestTemporarilyImmutable): def setUp(self): d = dict.fromkeys(xrange(n)) - self.it = d.items() + self.it = iter(d.items()) self.mutate = d.popitem class TestDictValues(TestTemporarilyImmutable): def setUp(self): d = dict.fromkeys(xrange(n)) - self.it = d.values() + self.it = iter(d.values()) self.mutate = d.popitem class TestSet(TestTemporarilyImmutable):