Skip to content

Commit

Permalink
test: reproduce #136
Browse files Browse the repository at this point in the history
  • Loading branch information
ltbringer committed Mar 29, 2022
1 parent 5576f43 commit 8943fb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/workflow/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ def test_safe_flush():


def test_flush_on_exception():

class FailingPlugin(Plugin):
def __init__(self, dest: str = None, debug: bool = False) -> None:
super().__init__(dest=dest, debug=debug)

def utility(self, _: Input, _o: Output) -> int:
return 0/0

workflow = Workflow([FailingPlugin])
workflow.set("output.intent", Intent(name="test", score=0.5))
workflow = Workflow([FailingPlugin()])
workflow.set("output.intents", [Intent(name="test", score=0.5)])
try:
workflow.run(Input(utterances=["apples"]))
except ZeroDivisionError:
pass
finally:
assert workflow.output == Output()
assert workflow.input == None

0 comments on commit 8943fb2

Please sign in to comment.