Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Jan 10, 2025
1 parent 28266fa commit 4598e0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions libs/core/tests/unit_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def blockbuster() -> Iterator[BlockBuster]:
"langsmith/client.py", "_default_retry_config"
)

for bb_function in bb.functions.values():
bb_function.can_block_in(
"freezegun/api.py", "_get_cached_module_attributes"
)

yield bb


Expand Down
4 changes: 1 addition & 3 deletions libs/core/tests/unit_tests/runnables/test_fallbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ def test_fallbacks(
"runnable",
["llm", "llm_multi", "chain", "chain_pass_exceptions"],
)
async def test_fallbacks_async(
runnable: RunnableWithFallbacks, request: Any, snapshot: SnapshotAssertion
) -> None:
async def test_fallbacks_async(runnable: RunnableWithFallbacks, request: Any) -> None:
runnable = request.getfixturevalue(runnable)
assert await runnable.ainvoke("hello") == "bar"
assert await runnable.abatch(["hi", "hey", "bye"]) == ["bar"] * 3
Expand Down
1 change: 1 addition & 0 deletions libs/core/tests/unit_tests/runnables/test_runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2844,6 +2844,7 @@ def test_router_runnable(mocker: MockerFixture, snapshot: SnapshotAssertion) ->
assert len(router_run.child_runs) == 2


@freeze_time("2023-01-01")
async def test_router_runnable_async() -> None:
chain1: Runnable = ChatPromptTemplate.from_template(
"You are a math genius. Answer the question: {question}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ async def test_tracer_nested_runs_on_error() -> None:
run_id=llm_uuid3,
parent_run_id=tool_uuid,
)

await tracer.on_llm_error(exception, run_id=llm_uuid3)
await tracer.on_tool_error(exception, run_id=tool_uuid)
await tracer.on_chain_error(exception, run_id=chain_uuid)
Expand Down

0 comments on commit 4598e0d

Please sign in to comment.