Skip to content

Commit

Permalink
fix error container
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume De Saint Martin committed May 8, 2020
1 parent b324a4d commit 65c10bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion octobot_commons/asyncio_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ async def check(self) -> None:
:return: None
"""
if self.errors:
raise AssertionError(self.errors)
raise AssertionError(str(self.errors))
3 changes: 2 additions & 1 deletion tests/test_asyncio_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async def test_without_error_container():
async def test_with_error_container():
error_container = ErrorContainer()
asyncio.get_event_loop().set_exception_handler(error_container.exception_handler)
asyncio.get_event_loop().set_exception_handler(error_container.exception_handler)
# will propagate exception
asyncio.get_event_loop().call_soon(_exception_raiser)
with pytest.raises(AssertionError):
Expand All @@ -38,4 +39,4 @@ async def test_with_error_container():


def _exception_raiser():
raise RuntimeError()
raise RuntimeError("error")

0 comments on commit 65c10bd

Please sign in to comment.