@@ -292,9 +292,10 @@ def test_pyscript_requires_an_argument(base_app, capsys):
292292 assert "the following arguments are required: script_path" in err
293293
294294
295- def test_base_error (base_app ):
296- out = run_cmd (base_app , 'meow' )
297- assert "is not a recognized command" in out [0 ]
295+ def test_base_error (base_app , capsys ):
296+ run_cmd (base_app , 'meow' )
297+ out , err = capsys .readouterr ()
298+ assert "is not a recognized command" in err
298299
299300
300301def test_base_load (base_app , request ):
@@ -2199,23 +2200,27 @@ def disable_commands_app():
21992200 return app
22002201
22012202
2202- def test_disable_and_enable_category (disable_commands_app ):
2203+ def test_disable_and_enable_category (disable_commands_app , capsys ):
22032204 # Disable the category
22042205 message_to_print = 'These commands are currently disabled'
22052206 disable_commands_app .disable_category (disable_commands_app .category_name , message_to_print )
22062207
22072208 # Make sure all the commands and help on those commands displays the message
2208- out = run_cmd (disable_commands_app , 'has_help_func' )
2209- assert out == [message_to_print ]
2209+ run_cmd (disable_commands_app , 'has_help_func' )
2210+ out , err = capsys .readouterr ()
2211+ assert err .startswith (message_to_print )
22102212
2211- out = run_cmd (disable_commands_app , 'help has_help_func' )
2212- assert out == [message_to_print ]
2213+ run_cmd (disable_commands_app , 'help has_help_func' )
2214+ out , err = capsys .readouterr ()
2215+ assert err .startswith (message_to_print )
22132216
2214- out = run_cmd (disable_commands_app , 'has_no_help_func' )
2215- assert out == [message_to_print ]
2217+ run_cmd (disable_commands_app , 'has_no_help_func' )
2218+ out , err = capsys .readouterr ()
2219+ assert err .startswith (message_to_print )
22162220
2217- out = run_cmd (disable_commands_app , 'help has_no_help_func' )
2218- assert out == [message_to_print ]
2221+ run_cmd (disable_commands_app , 'help has_no_help_func' )
2222+ out , err = capsys .readouterr ()
2223+ assert err .startswith (message_to_print )
22192224
22202225 visible_commands = disable_commands_app .get_visible_commands ()
22212226 assert 'has_help_func' not in visible_commands
0 commit comments