Skip to content

Commit a232620

Browse files
committed
Apply a couple automated ruff SIM refactorings
1 parent d67c73d commit a232620

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/test_argparse_custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_override_parser() -> None:
249249
)
250250

251251
# The standard parser is Cmd2ArgumentParser
252-
assert argparse_custom.DEFAULT_ARGUMENT_PARSER == Cmd2ArgumentParser
252+
assert Cmd2ArgumentParser == argparse_custom.DEFAULT_ARGUMENT_PARSER
253253

254254
# Set our parser module and force a reload of cmd2 so it loads the module
255255
argparse.cmd2_parser_module = 'examples.custom_parser'
@@ -260,7 +260,7 @@ def test_override_parser() -> None:
260260
CustomParser,
261261
)
262262

263-
assert argparse_custom.DEFAULT_ARGUMENT_PARSER == CustomParser
263+
assert CustomParser == argparse_custom.DEFAULT_ARGUMENT_PARSER
264264

265265

266266
def test_apcustom_metavar_tuple() -> None:

tests_isolated/test_commandset/test_commandset.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def test_subcommands(command_sets_manual) -> None:
553553

554554
assert first_match is not None
555555
# check that the alias shows up correctly
556-
assert ['banana', 'bananer', 'bokchoy'] == command_sets_manual.completion_matches
556+
assert command_sets_manual.completion_matches == ['banana', 'bananer', 'bokchoy']
557557

558558
cmd_result = command_sets_manual.app_cmd('cut banana discs')
559559
assert 'cutting banana: discs' in cmd_result.stdout
@@ -566,7 +566,7 @@ def test_subcommands(command_sets_manual) -> None:
566566

567567
assert first_match is not None
568568
# verify that argparse completer in commandset functions correctly
569-
assert ['diced', 'quartered'] == command_sets_manual.completion_matches
569+
assert command_sets_manual.completion_matches == ['diced', 'quartered']
570570

571571
# verify that command set uninstalls without problems
572572
command_sets_manual.unregister_command_set(fruit_cmds)
@@ -598,7 +598,7 @@ def test_subcommands(command_sets_manual) -> None:
598598

599599
assert first_match is not None
600600
# check that the alias shows up correctly
601-
assert ['banana', 'bananer', 'bokchoy'] == command_sets_manual.completion_matches
601+
assert command_sets_manual.completion_matches == ['banana', 'bananer', 'bokchoy']
602602

603603
text = ''
604604
line = f'cut bokchoy {text}'
@@ -608,7 +608,7 @@ def test_subcommands(command_sets_manual) -> None:
608608

609609
assert first_match is not None
610610
# verify that argparse completer in commandset functions correctly
611-
assert ['diced', 'quartered'] == command_sets_manual.completion_matches
611+
assert command_sets_manual.completion_matches == ['diced', 'quartered']
612612

613613
# disable again and verify can still uninstnall
614614
command_sets_manual.disable_command('cut', 'disabled for test')
@@ -763,7 +763,7 @@ def test_static_subcommands(static_subcommands_app) -> None:
763763

764764
assert first_match is not None
765765
# check that the alias shows up correctly
766-
assert ['banana', 'bananer', 'bokchoy'] == static_subcommands_app.completion_matches
766+
assert static_subcommands_app.completion_matches == ['banana', 'bananer', 'bokchoy']
767767

768768
text = ''
769769
line = f'cut bokchoy {text}'
@@ -773,7 +773,7 @@ def test_static_subcommands(static_subcommands_app) -> None:
773773

774774
assert first_match is not None
775775
# verify that argparse completer in commandset functions correctly
776-
assert ['diced', 'quartered'] == static_subcommands_app.completion_matches
776+
assert static_subcommands_app.completion_matches == ['diced', 'quartered']
777777

778778

779779
complete_states_expected_self = None

0 commit comments

Comments
 (0)