Преглед изворни кода

Add contextmanager methods to testing Pipeline

Justin Patrin пре 9 година
родитељ
комит
0fc2d1048d
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      celery/tests/backends/test_redis.py

+ 6 - 0
celery/tests/backends/test_redis.py

@@ -37,6 +37,12 @@ class Pipeline(object):
             return self
         return add_step
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, traceback):
+        pass
+
     def execute(self):
         return [step(*a, **kw) for step, a, kw in self.steps]