MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _close_and_raise

Function _close_and_raise

tests/cli/test_main_coverage.py:1592–1599  ·  view source on GitHub ↗

Return a side_effect that closes the coroutine then raises *exc*.

(exc)

Source from the content-addressed store, hash-verified

1590
1591# Helper: side_effect for asyncio.run that closes the coroutine and raises
1592def _close_and_raise(exc):
1593 """Return a side_effect that closes the coroutine then raises *exc*."""
1594
1595 def _side_effect(coro):
1596 coro.close()
1597 raise exc
1598
1599 return _side_effect
1600
1601
1602# Helper: side_effect for asyncio.run that actually runs the coroutine

Calls

no outgoing calls

Tested by

no test coverage detected