@@ -746,7 +746,7 @@ def do_user_unrelated(self, ns: argparse.Namespace):
746
746
self ._cmd .poutput ('something {}' .format (ns .state ))
747
747
748
748
749
- def test_cross_commandset_completer (command_sets_manual ):
749
+ def test_cross_commandset_completer (command_sets_manual , capsys ):
750
750
global complete_states_expected_self
751
751
# This tests the different ways to locate the matching CommandSet when completing an argparse argument.
752
752
# Exercises the 3 cases in cmd2.Cmd._resolve_func_self().
@@ -844,9 +844,11 @@ def test_cross_commandset_completer(command_sets_manual):
844
844
endidx = len (line )
845
845
begidx = endidx
846
846
first_match = complete_tester (text , line , begidx , endidx , command_sets_manual )
847
+ out , err = capsys .readouterr ()
847
848
848
849
assert first_match is None
849
850
assert command_sets_manual .completion_matches == []
851
+ assert "Could not find CommandSet instance" in out
850
852
851
853
command_sets_manual .unregister_command_set (user_unrelated )
852
854
@@ -865,9 +867,11 @@ def test_cross_commandset_completer(command_sets_manual):
865
867
endidx = len (line )
866
868
begidx = endidx
867
869
first_match = complete_tester (text , line , begidx , endidx , command_sets_manual )
870
+ out , err = capsys .readouterr ()
868
871
869
872
assert first_match is None
870
873
assert command_sets_manual .completion_matches == []
874
+ assert "Could not find CommandSet instance" in out
871
875
872
876
command_sets_manual .unregister_command_set (user_unrelated )
873
877
command_sets_manual .unregister_command_set (user_sub2 )
0 commit comments