Explorar o código

Add contextmanager methods to testing Pipeline

Justin Patrin %!s(int64=9) %!d(string=hai) anos
pai
achega
0fc2d1048d
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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]