Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
baur-krykpayev authored Jun 19, 2024
2 parents 02a9095 + 94452a9 commit 44bcc46
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import asyncio
import sys
import uuid
from functools import partial
from itertools import cycle
from typing import (
Any,
Expand Down Expand Up @@ -346,6 +347,22 @@ def reverse(s: str) -> str:
]


async def test_event_stream_exception() -> None:
def step(name: str, err: Optional[str], val: str) -> str:
if err:
raise ValueError(err)
return val + name[-1]

chain = (
RunnableLambda(partial(step, "step1", None))
| RunnableLambda(partial(step, "step2", "ERR"))
| RunnableLambda(partial(step, "step3", None))
)

with pytest.raises(ValueError, match="ERR"):
await _collect_events(chain.astream_events("X", version="v2"))


async def test_event_stream_with_triple_lambda_test_filtering() -> None:
"""Test filtering based on tags / names"""

Expand Down

0 comments on commit 44bcc46

Please sign in to comment.