Skip to content

Commit 8bdab2d

Browse files
committed
test(profiler): the missing-Agno warning names Agno
Signed-off-by: Somay-kousis <somaykaush@gmail.com>
1 parent d384f66 commit 8bdab2d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎packages/nvidia_nat_profiler/tests/decorators/test_framework_wrapper.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,19 @@ def test_framework_wrapper_re_exports_the_core_hook():
5858
assert framework_wrapper.chain_wrapped_build_fn is framework_instrumentation.chain_wrapped_build_fn
5959
assert framework_wrapper.set_framework_profiler_handler is framework_instrumentation.set_framework_profiler_handler
6060
assert utils.detect_llm_frameworks_in_build_fn is framework_instrumentation.detect_llm_frameworks_in_build_fn
61+
62+
63+
async def test_missing_agno_handler_warning_names_agno(monkeypatch, caplog):
64+
monkeypatch.setitem(sys.modules, "nat.plugins.agno.callback_handler", None) # import fails
65+
monkeypatch.setitem(framework_wrapper._library_instrumented, "agno", False)
66+
67+
@asynccontextmanager
68+
async def build_fn(config, builder) -> AsyncIterator[str]:
69+
yield "workflow"
70+
71+
wrapped = framework_wrapper.set_framework_profiler_handler(None, [LLMFrameworkEnum.AGNO])(build_fn)
72+
async with wrapped(None, None):
73+
pass
74+
75+
messages = [record.getMessage() for record in caplog.records]
76+
assert any(message.startswith("Agno profiler not available") for message in messages), messages

0 commit comments

Comments
 (0)