Skip to content

Commit

Permalink
Merge pull request #1 from rouzwawi/exit-code
Browse files Browse the repository at this point in the history
PR on PR
  • Loading branch information
fabriziodemaria committed Apr 4, 2016
2 parents fb3d642 + 50c4aa5 commit c8e1ead
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions luigi/retcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class retcode(luigi.Config):
description='For both local --lock and luigid "lock"',
)
scheduling_error = IntParameter(default=4,
description='''For when a task's complete() or requires() fails.'''
)
description='''For when a task's complete() or requires() fails.'''
)


def run_with_retcodes(argv):
Expand Down
10 changes: 7 additions & 3 deletions test/worker_parallel_scheduling_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import mock
import psutil
from luigi.worker import Worker
from luigi.task_status import UNKNOWN


def running_children():
Expand Down Expand Up @@ -138,7 +139,8 @@ def test_multiprocess_scheduling_with_overlapping_dependencies(self):
def test_raise_exception_in_complete(self, send):
self.w.add(ExceptionCompleteTask(), multiprocess=True)
send.check_called_once()
self.assertEqual(0, self.sch.add_task.call_count)
self.assertEqual(UNKNOWN, self.sch.add_task.call_args[1]['status'])
self.assertFalse(self.sch.add_task.call_args[1]['runnable'])
self.assertTrue('assert False' in send.call_args[0][1])

@mock.patch('luigi.notifications.send_error_email')
Expand All @@ -154,14 +156,16 @@ def test_raise_unpicklable_exception_in_complete(self, send):
# verify this can run async
self.w.add(UnpicklableExceptionTask(), multiprocess=True)
send.check_called_once()
self.assertEqual(0, self.sch.add_task.call_count)
self.assertEqual(UNKNOWN, self.sch.add_task.call_args[1]['status'])
self.assertFalse(self.sch.add_task.call_args[1]['runnable'])
self.assertTrue('raise UnpicklableException()' in send.call_args[0][1])

@mock.patch('luigi.notifications.send_error_email')
def test_raise_exception_in_requires(self, send):
self.w.add(ExceptionRequiresTask(), multiprocess=True)
send.check_called_once()
self.assertEqual(0, self.sch.add_task.call_count)
self.assertEqual(UNKNOWN, self.sch.add_task.call_args[1]['status'])
self.assertFalse(self.sch.add_task.call_args[1]['runnable'])


if __name__ == '__main__':
Expand Down

0 comments on commit c8e1ead

Please sign in to comment.