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

TaskRunner refactor #260

Merged
merged 19 commits into from
Oct 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
  • Loading branch information
jlowin committed Oct 11, 2018
commit f636276de5d7c1d8b2112360f5565569274729da
5 changes: 3 additions & 2 deletions tests/engine/test_task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ def test_task_handler_that_doesnt_return_state(self):
with prefect.utilities.tests.raise_on_exception():
TaskRunner(task=task).run()

class TestTaskRunnerStateHandlers:

class TestTaskRunnerStateHandlers:
def test_task_runner_handlers_are_called(self):
TaskRunner(task=Task(), state_handlers=[task_runner_handler]).run()
# the task changed state twice: Pending -> Running -> Success
Expand Down Expand Up @@ -868,11 +868,12 @@ def test_task_runner_handler_that_doesnt_return_state(self):
# doesn't exist on None
with pytest.raises(AttributeError):
with prefect.utilities.tests.raise_on_exception():
TaskRunner(task=Task(), state_handlers=[lambda *a:None]).run()
TaskRunner(task=Task(), state_handlers=[lambda *a: None]).run()

def test_task_handler_that_raises_signal_is_trapped(self):
def handler(task, old, new):
raise signals.Fail()

task = Task(state_handlers=[handler])
state = TaskRunner(task=task).run()
assert state.is_failed()