Skip to content

Commit

Permalink
Merge pull request #789 from Tarrasch/override_defaults
Browse files Browse the repository at this point in the history
Override defaults
  • Loading branch information
Tarrasch committed Feb 25, 2015
2 parents 2c06085 + 618970a commit 541f408
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions luigi/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def run(tasks, worker_scheduler_factory=None, override_defaults=None):

if worker_scheduler_factory is None:
worker_scheduler_factory = WorkerSchedulerFactory()
if override_defaults is None:
override_defaults = {}
env_params = core(**override_defaults)
# search for logging configuration path first on the command line, then
# in the application config file
Expand Down
6 changes: 6 additions & 0 deletions test/interface_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def test_interface_run_positive_path(self):

self.assertTrue(self._run_interface())

def test_interface_default_override_defaults(self):
self.worker.add = Mock(side_effect=[True, True])
self.worker.run = Mock(return_value=True)

self.assertTrue(Interface.run([self.task_a, self.task_b], self.worker_scheduler_factory))

def test_interface_run_with_add_failure(self):
self.worker.add = Mock(side_effect=[True, False])
self.worker.run = Mock(return_value=True)
Expand Down

0 comments on commit 541f408

Please sign in to comment.