A node that raises propagates the exception to the caller.
()
| 169 | |
| 170 | @pytest.mark.asyncio |
| 171 | async def test_node_error_propagates(): |
| 172 | """A node that raises propagates the exception to the caller.""" |
| 173 | |
| 174 | class _Node(BaseNode): |
| 175 | |
| 176 | async def _run_impl( |
| 177 | self, *, ctx: Context, node_input: Any |
| 178 | ) -> AsyncGenerator[Any, None]: |
| 179 | raise RuntimeError('node failure') |
| 180 | yield # pylint: disable=unreachable |
| 181 | |
| 182 | with pytest.raises(RuntimeError, match='node failure'): |
| 183 | await _run_node(_Node(name='error')) |
| 184 | |
| 185 | |
| 186 | @pytest.mark.asyncio |