Explorar o código

group cannot override dict.__iter__: now returns list of keys, not list of tasks. Closes #3688

Ask Solem %!s(int64=8) %!d(string=hai) anos
pai
achega
8c7ac5d84d
Modificáronse 2 ficheiros con 1 adicións e 4 borrados
  1. 0 3
      celery/canvas.py
  2. 1 1
      t/unit/tasks/test_canvas.py

+ 0 - 3
celery/canvas.py

@@ -1123,9 +1123,6 @@ class group(Signature):
                                   chord=chord, root_id=root_id,
                                   parent_id=parent_id)
 
-    def __iter__(self):
-        return iter(self.tasks)
-
     def __repr__(self):
         if self.tasks:
             return remove_repeating_from_task(

+ 1 - 1
t/unit/tasks/test_canvas.py

@@ -534,7 +534,7 @@ class test_group(CanvasCase):
 
     def test_iter(self):
         g = group([self.add.s(i, i) for i in range(10)])
-        assert list(iter(g)) == g.tasks
+        assert list(iter(g)) == list(g.keys())
 
     @staticmethod
     def helper_test_get_delay(result):