@@ -280,8 +280,7 @@ def _onchange_quiet(self, name, old, new) -> None:
280
280
281
281
@pytest .fixture
282
282
def onchange_app ():
283
- app = OnChangeHookApp ()
284
- return app
283
+ return OnChangeHookApp ()
285
284
286
285
287
286
def test_set_onchange_hook (onchange_app ) -> None :
@@ -847,15 +846,13 @@ def _expected_no_editor_error():
847
846
if hasattr (sys , "pypy_translation_info" ):
848
847
expected_exception = 'EnvironmentError'
849
848
850
- expected_text = normalize (
849
+ return normalize (
851
850
f"""
852
851
EXCEPTION of type '{ expected_exception } ' occurred with message: Please use 'set editor' to specify your text editing program of choice.
853
852
To enable full traceback, run the following command: 'set debug true'
854
853
"""
855
854
)
856
855
857
- return expected_text
858
-
859
856
860
857
def test_base_debug (base_app ) -> None :
861
858
# Purposely set the editor to None
@@ -1086,8 +1083,7 @@ def postparsing_precmd(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.P
1086
1083
1087
1084
@pytest .fixture
1088
1085
def hook_failure ():
1089
- app = HookFailureApp ()
1090
- return app
1086
+ return HookFailureApp ()
1091
1087
1092
1088
1093
1089
def test_precmd_hook_success (base_app ) -> None :
@@ -1211,8 +1207,7 @@ def do_parser_cmd(self, args) -> None:
1211
1207
1212
1208
@pytest .fixture
1213
1209
def help_app ():
1214
- app = HelpApp ()
1215
- return app
1210
+ return HelpApp ()
1216
1211
1217
1212
1218
1213
def test_custom_command_help (help_app ) -> None :
@@ -1285,8 +1280,7 @@ def do_undoc(self, arg) -> None:
1285
1280
1286
1281
@pytest .fixture
1287
1282
def helpcat_app ():
1288
- app = HelpCategoriesApp ()
1289
- return app
1283
+ return HelpCategoriesApp ()
1290
1284
1291
1285
1292
1286
def test_help_cat_base (helpcat_app ) -> None :
@@ -1342,8 +1336,7 @@ def do_return_type(self, arg) -> None:
1342
1336
1343
1337
@pytest .fixture
1344
1338
def select_app ():
1345
- app = SelectApp ()
1346
- return app
1339
+ return SelectApp ()
1347
1340
1348
1341
1349
1342
def test_select_options (select_app , monkeypatch ) -> None :
@@ -1592,8 +1585,7 @@ def do_orate(self, opts, arg) -> None:
1592
1585
1593
1586
@pytest .fixture
1594
1587
def multiline_app ():
1595
- app = MultilineApp ()
1596
- return app
1588
+ return MultilineApp ()
1597
1589
1598
1590
1599
1591
def test_multiline_complete_empty_statement_raises_exception (multiline_app ) -> None :
@@ -1759,8 +1751,7 @@ def do_negative_no_data(self, arg) -> None:
1759
1751
1760
1752
@pytest .fixture
1761
1753
def commandresult_app ():
1762
- app = CommandResultApp ()
1763
- return app
1754
+ return CommandResultApp ()
1764
1755
1765
1756
1766
1757
def test_commandresult_truthy (commandresult_app ) -> None :
@@ -2813,8 +2804,7 @@ def do_has_no_helper_funcs(self, arg) -> None:
2813
2804
2814
2805
@pytest .fixture
2815
2806
def disable_commands_app ():
2816
- app = DisableCommandsApp ()
2817
- return app
2807
+ return DisableCommandsApp ()
2818
2808
2819
2809
2820
2810
def test_disable_and_enable_category (disable_commands_app ) -> None :
0 commit comments