Parcourir la source

[Py3] fixes for tests

Ask Solem il y a 12 ans
Parent
commit
f90a3c1414
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 2 2
      celery/tests/worker/test_hub.py
  2. 1 0
      celery/tests/worker/test_loops.py

+ 2 - 2
celery/tests/worker/test_hub.py

@@ -225,7 +225,7 @@ class test_Hub(Case):
         hub = Hub()
         hub.readers = {1: Mock(), 2: Mock()}
         hub.writers = {3: Mock(), 4: Mock()}
-        for value in hub.readers.values() + hub.writers.values():
+        for value in list(hub.readers.values()) + list(hub.writers.values()):
             value.__name__ = 'mock'
         self.assertTrue(hub.repr_active())
 
@@ -233,7 +233,7 @@ class test_Hub(Case):
         hub = Hub()
         hub.readers = {6: Mock(), 7: Mock(), 8: Mock()}
         hub.writers = {9: Mock()}
-        for value in hub.readers.values() + hub.writers.values():
+        for value in list(hub.readers.values()) + list(hub.writers.values()):
             value.__name__ = 'mock'
         self.assertTrue(hub.repr_events([
             (6, READ),

+ 1 - 0
celery/tests/worker/test_loops.py

@@ -49,6 +49,7 @@ class X(object):
         self.hub.on_task = on_task or []
         self.hub.readers = {}
         self.hub.writers = {}
+        self.hub.fire_timers.return_value = 1.7
         self.Hub = self.hub
 
     def timeout_then_error(self, mock):