@@ -25,7 +25,7 @@ def add(a: int, b: int) -> None:
25
25
def test_app_just_one_cli (capsys ):
26
26
# Test: `python my_script.py --help`
27
27
with pytest .raises (SystemExit ):
28
- app_just_one .cli (args = ["--help" ], sort_subcommands = False )
28
+ app_just_one .cli (args = ["--help" ])
29
29
captured = capsys .readouterr ()
30
30
assert "usage: " in captured .out
31
31
assert "greet" not in captured .out
@@ -44,13 +44,13 @@ def test_app_cli(capsys):
44
44
45
45
# Test: `python my_script.py greet --help`
46
46
with pytest .raises (SystemExit ):
47
- app .cli (args = ["greet" , "--help" ])
47
+ app .cli (args = ["greet" , "--help" ], sort_subcommands = False )
48
48
captured = capsys .readouterr ()
49
49
assert "usage: " in captured .out
50
50
assert "Greet someone." in captured .out
51
51
52
52
# Test: `python my_script.py greet --name Alice`
53
- app .cli (args = ["greet" , "--name" , "Alice" ])
53
+ app .cli (args = ["greet" , "--name" , "Alice" ], sort_subcommands = True )
54
54
captured = capsys .readouterr ()
55
55
assert captured .out .strip () == "Hello, Alice!"
56
56
0 commit comments