File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -690,18 +690,26 @@ def get_inner_toolset(toolset: DynamicToolset[None] | None) -> EnterableToolset
690690 async with toolset :
691691 assert not toolset ._toolset # pyright: ignore[reportPrivateUsage]
692692
693+ # Test that calling get_tools initializes the toolset
693694 tools = await toolset .get_tools (run_context )
694695
695696 assert (inner_toolset := get_inner_toolset (toolset ))
696697 assert inner_toolset .depth_count == 1
697698
699+ # Test that the visitor applies when the toolset is initialized
698700 def visitor (toolset : AbstractToolset [None ]) -> None :
699701 assert toolset is inner_toolset
700702
701703 toolset .apply (visitor )
702704
703705 assert get_inner_toolset (toolset ) is None
704706
707+ # Test that the visitor doesn't apply when the toolset is not initialized
708+ def crash_visitor (toolset : AbstractToolset [None ]) -> None :
709+ raise Exception ('crash' )
710+
711+ assert toolset .apply (crash_visitor ) is None
712+
705713 assert tools == {}
706714
707715
You can’t perform that action at this time.
0 commit comments