Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taskset failed() result is incorrect (patch) #132

Closed
foobarto opened this issue Jun 14, 2010 · 0 comments
Closed

Taskset failed() result is incorrect (patch) #132

foobarto opened this issue Jun 14, 2010 · 0 comments

Comments

@foobarto
Copy link

Calling failed() on a taskset returns True if some tasks are still pending (it treats pending tasks as failed tasks right now in other words).

Below patch:

--- a/result.py
+++ b/result.py
@@ -85,6 +85,14 @@

         """
         return self.backend.is_successful(self.task_id)
+    
+    def failed(self):
+        """Returns ``True`` if the task failed
+        
+        :rtype: bool
+        
+        """
+        return self.backend.get_status(self.task_id)==states.FAILURE

     def __str__(self):
         """``str(self)`` -> ``self.task_id``"""
@@ -223,7 +231,7 @@
             (i.e., raised an exception)

         """
-        return any((not subtask.successful()
+        return any((subtask.failed()
                         for subtask in self.itersubtasks()))

     def waiting(self):
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant