Skip to content

Commit

Permalink
Merge branch 'master' of github.com:robinhood/faust
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Jan 8, 2020
2 parents abcd7d2 + 3c329bf commit a9450e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faust/agents/agent.py
Expand Up @@ -435,7 +435,7 @@ def info(self) -> Mapping:
'channel': self.channel,
'concurrency': self.concurrency,
'help': self.help,
'sinks': self._sinks,
'sink': self._sinks,
'on_error': self._on_error,
'supervisor_strategy': self.supervisor_strategy,
'isolated_partitions': self.isolated_partitions,
Expand Down
14 changes: 13 additions & 1 deletion t/unit/agents/test_agent.py
Expand Up @@ -361,7 +361,7 @@ def test_info(self, *, agent):
'channel': agent.channel,
'concurrency': agent.concurrency,
'help': agent.help,
'sinks': agent._sinks,
'sink': agent._sinks,
'on_error': agent._on_error,
'supervisor_strategy': agent.supervisor_strategy,
'isolated_partitions': agent.isolated_partitions,
Expand Down Expand Up @@ -898,3 +898,15 @@ def test_channel_iterator(self, *, agent):

def test_label(self, *, agent):
assert label(agent)

async def test_context_calls_sink(self, *, agent):
class SinkCalledException(Exception):
pass

def dummy_sink(_):
raise SinkCalledException()

agent.add_sink(dummy_sink)
async with agent.test_context() as agent_mock:
with pytest.raises(SinkCalledException):
await agent_mock.put('hello')

0 comments on commit a9450e2

Please sign in to comment.