mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 11:39:18 +00:00
[core] add test for json parser (#15297)
this should fail, but isnt --------- Co-authored-by: Nuno Campos <nuno@langchain.dev>
This commit is contained in:
@@ -487,3 +487,9 @@ async def test_partial_text_json_output_parser_diff_async() -> None:
|
||||
chain = input_iter | SimpleJsonOutputParser(diff=True)
|
||||
|
||||
assert [p async for p in chain.astream(None)] == EXPECTED_STREAMED_JSON_DIFF
|
||||
|
||||
|
||||
def test_raises_error() -> None:
|
||||
parser = SimpleJsonOutputParser()
|
||||
with pytest.raises(Exception):
|
||||
parser.invoke("hi")
|
||||
|
Reference in New Issue
Block a user