@@ -746,7 +746,7 @@ def do_user_unrelated(self, ns: argparse.Namespace):
746746 self ._cmd .poutput ('something {}' .format (ns .state ))
747747
748748
749- def test_cross_commandset_completer (command_sets_manual ):
749+ def test_cross_commandset_completer (command_sets_manual , capsys ):
750750 global complete_states_expected_self
751751 # This tests the different ways to locate the matching CommandSet when completing an argparse argument.
752752 # Exercises the 3 cases in cmd2.Cmd._resolve_func_self().
@@ -844,9 +844,11 @@ def test_cross_commandset_completer(command_sets_manual):
844844 endidx = len (line )
845845 begidx = endidx
846846 first_match = complete_tester (text , line , begidx , endidx , command_sets_manual )
847+ out , err = capsys .readouterr ()
847848
848849 assert first_match is None
849850 assert command_sets_manual .completion_matches == []
851+ assert "Could not find CommandSet instance" in out
850852
851853 command_sets_manual .unregister_command_set (user_unrelated )
852854
@@ -865,9 +867,11 @@ def test_cross_commandset_completer(command_sets_manual):
865867 endidx = len (line )
866868 begidx = endidx
867869 first_match = complete_tester (text , line , begidx , endidx , command_sets_manual )
870+ out , err = capsys .readouterr ()
868871
869872 assert first_match is None
870873 assert command_sets_manual .completion_matches == []
874+ assert "Could not find CommandSet instance" in out
871875
872876 command_sets_manual .unregister_command_set (user_unrelated )
873877 command_sets_manual .unregister_command_set (user_sub2 )
0 commit comments