@@ -45,8 +45,8 @@ def test_main_subcommand_without_args_prints_help():
4545 app ,
4646 [],
4747 )
48- assert result .exit_code == 0
49- assert "Show this message and exit." in result .stdout
48+ assert result .exit_code == 2
49+ assert "Show this message and exit." in result .stderr
5050
5151
5252class TestSet :
@@ -78,13 +78,13 @@ def test_calls_all_stuff_in_right_order(self, mocker):
7878 def test_validates_minutes (self ):
7979 result = runner .invoke (app , ["set" , "-c" , "echo foo" , "-h" , "8" , "-m" , "66" ])
8080
81- assert "Invalid value" in result .stdout
82- assert "66 is not in the range 0<=x<=59" in result .stdout
81+ assert "Invalid value" in result .stderr
82+ assert "66 is not in the range 0<=x<=59" in result .stderr
8383
8484 def test_validates_hours (self ):
8585 result = runner .invoke (app , ["set" , "-c" , "echo foo" , "-h" , "66" , "-m" , "1" ])
86- assert "Invalid value" in result .stdout
87- assert "66 is not in the range 0<=x<=23" in result .stdout
86+ assert "Invalid value" in result .stderr
87+ assert "66 is not in the range 0<=x<=23" in result .stderr
8888
8989 def test_logs_warning_when_create_schedule_raises (self , mocker ):
9090 mock_logger = mocker .patch ("cli.schedule.get_logger" ).return_value
@@ -259,7 +259,7 @@ def test_logs_only_value_of_requested_task_spec(self, mocker, task_from_id):
259259
260260 def test_complains_when_no_id_provided (self ):
261261 result = runner .invoke (app , ["get" , "--command" ])
262- assert "Missing argument 'id'" in result .stdout
262+ assert "Missing argument 'id'" in result .stderr
263263
264264
265265class TestList :
@@ -302,7 +302,7 @@ def test_warns_when_wrong_format_provided(self, mocker, task_list):
302302
303303 assert mock_tabulate .call_count == 0
304304 assert wrong_format not in tabulate_formats
305- assert "Table format has to be one of" in result .stdout
305+ assert "Table format has to be one of" in result .stderr
306306
307307
308308class TestUpdate :
@@ -356,15 +356,15 @@ def test_ensures_proper_hourly_params(self, mocker):
356356
357357 def test_validates_minute (self ):
358358 result = runner .invoke (app , ["update" , "42" , "--minute" , "88" ])
359- assert "88 is not in the range 0<=x<=59" in result .stdout
359+ assert "88 is not in the range 0<=x<=59" in result .stderr
360360
361361 def test_validates_hour (self ):
362362 result = runner .invoke (app , ["update" , "42" , "--daily" , "--hour" , "33" ])
363- assert "33 is not in the range 0<=x<=23" in result .stdout
363+ assert "33 is not in the range 0<=x<=23" in result .stderr
364364
365365 def test_complains_when_no_id_provided (self ):
366366 result = runner .invoke (app , ["update" ])
367- assert "Missing argument 'id'" in result .stdout
367+ assert "Missing argument 'id'" in result .stderr
368368
369369 def test_exits_early_when_nothing_to_update (self , mocker ):
370370 mock_logger = mocker .patch ("cli.schedule.get_logger" ).return_value
0 commit comments