2626import mock
2727import psutil
2828from luigi .worker import Worker
29+ from luigi .task_status import UNKNOWN
2930
3031
3132def running_children ():
@@ -138,7 +139,8 @@ def test_multiprocess_scheduling_with_overlapping_dependencies(self):
138139 def test_raise_exception_in_complete (self , send ):
139140 self .w .add (ExceptionCompleteTask (), multiprocess = True )
140141 send .check_called_once ()
141- self .assertEqual (0 , self .sch .add_task .call_count )
142+ self .assertEqual (UNKNOWN , self .sch .add_task .call_args [1 ]['status' ])
143+ self .assertFalse (self .sch .add_task .call_args [1 ]['runnable' ])
142144 self .assertTrue ('assert False' in send .call_args [0 ][1 ])
143145
144146 @mock .patch ('luigi.notifications.send_error_email' )
@@ -154,14 +156,16 @@ def test_raise_unpicklable_exception_in_complete(self, send):
154156 # verify this can run async
155157 self .w .add (UnpicklableExceptionTask (), multiprocess = True )
156158 send .check_called_once ()
157- self .assertEqual (0 , self .sch .add_task .call_count )
159+ self .assertEqual (UNKNOWN , self .sch .add_task .call_args [1 ]['status' ])
160+ self .assertFalse (self .sch .add_task .call_args [1 ]['runnable' ])
158161 self .assertTrue ('raise UnpicklableException()' in send .call_args [0 ][1 ])
159162
160163 @mock .patch ('luigi.notifications.send_error_email' )
161164 def test_raise_exception_in_requires (self , send ):
162165 self .w .add (ExceptionRequiresTask (), multiprocess = True )
163166 send .check_called_once ()
164- self .assertEqual (0 , self .sch .add_task .call_count )
167+ self .assertEqual (UNKNOWN , self .sch .add_task .call_args [1 ]['status' ])
168+ self .assertFalse (self .sch .add_task .call_args [1 ]['runnable' ])
165169
166170
167171if __name__ == '__main__' :
0 commit comments