test(host-python): preserve pre-async hook coverage after execution handoff

This commit is contained in:
Yujong Lee 2026-10-13 21:38:20 -07:00
parent a60a6a0a38
commit 79dd74e961

View file

@ -520,9 +520,9 @@ impl litellm_host_python::ExecutionBody for Preparing {
fn lifecycle(py: Python<'_>) -> PyResult<Bound<'_, PyModule>> {
let source =
std::ffi::CString::new(include_str!("../../../../litellm/rust_bridge/lifecycle.py"))
std::ffi::CString::new(include_str!("../../../../litellm/rust_bridge/execution.py"))
.unwrap();
PyModule::from_code(py, &source, c"lifecycle.py", c"hook_chain_test_lifecycle")
PyModule::from_code(py, &source, c"execution.py", c"hook_chain_test_lifecycle")
}
#[rstest]
@ -562,7 +562,10 @@ second = Hooks('b', invoke)
let call = module
.getattr("drive")
.unwrap()
.call1((Py::new(py, execution).unwrap(), module.getattr("Stream").unwrap()))
.call1((
Py::new(py, execution).unwrap(),
module.getattr("AsyncStream").unwrap(),
))
.unwrap();
locals.set_item("call", call).unwrap();
py.run(