|
41 | 41 |
|
42 | 42 |
|
43 | 43 | pytestmark = pytest.mark.usefixtures("integration") |
| 44 | +no_idea_what_template = """ |
| 45 | +No idea what '{0}' is! |
| 46 | +'{0}' is not an invoke command. See 'invoke --list'. |
| 47 | +
|
| 48 | +No suggestions was found. |
| 49 | +
|
| 50 | +""".lstrip() |
44 | 51 |
|
45 | 52 |
|
46 | 53 | class Program_: |
@@ -360,7 +367,7 @@ def seeks_and_loads_tasks_module_by_default(self): |
360 | 367 | def does_not_seek_tasks_module_if_namespace_was_given(self): |
361 | 368 | expect( |
362 | 369 | "foo", |
363 | | - err="No idea what 'foo' is!\n", |
| 370 | + err=no_idea_what_template.format("foo"), |
364 | 371 | program=Program(namespace=Collection("blank")), |
365 | 372 | ) |
366 | 373 |
|
@@ -402,7 +409,7 @@ def ParseErrors_display_message_and_exit_1(self, mock_exit): |
402 | 409 | # "no idea what foo is!") and exit 1. (Intent is to display that |
403 | 410 | # info w/o a full traceback, basically.) |
404 | 411 | stderr = sys.stderr.getvalue() |
405 | | - assert stderr == "No idea what '{}' is!\n".format(nah) |
| 412 | + assert stderr == no_idea_what_template.format(nah) |
406 | 413 | mock_exit.assert_called_with(1) |
407 | 414 |
|
408 | 415 | @trap |
@@ -599,6 +606,7 @@ def core_help_option_prints_core_help(self): |
599 | 606 | -r STRING, --search-root=STRING Change root directory used for finding |
600 | 607 | task modules. |
601 | 608 | -R, --dry Echo commands instead of running. |
| 609 | + -s, --[no-]suggestions Show possible commands suggestions. |
602 | 610 | -T INT, --command-timeout=INT Specify a global command execution |
603 | 611 | timeout, in seconds. |
604 | 612 | -V, --version Show version and exit. |
@@ -736,7 +744,8 @@ def exits_after_printing(self): |
736 | 744 | expect("-c decorators -h punch --list", out=expected) |
737 | 745 |
|
738 | 746 | def complains_if_given_invalid_task_name(self): |
739 | | - expect("-h this", err="No idea what 'this' is!\n") |
| 747 | + expected = no_idea_what_template.format("this") |
| 748 | + expect("-h this", err=expected) |
740 | 749 |
|
741 | 750 | class task_list: |
742 | 751 | "--list" |
|
0 commit comments