diff --git a/httpie/cli/utils.py b/httpie/cli/utils.py index ad27da37f7..e65e75c65b 100644 --- a/httpie/cli/utils.py +++ b/httpie/cli/utils.py @@ -54,12 +54,7 @@ def load(self) -> T: return self._obj @property - def help(self) -> str: - if self._help is None and self.help_formatter is not None: - self._help = self.help_formatter( - self.load(), - isolation_mode=self.isolation_mode - ) + def help(self) -> str | None: return self._help @help.setter diff --git a/tests/test_cli_utils.py b/tests/test_cli_utils.py index 8041727b57..5a8936e205 100644 --- a/tests/test_cli_utils.py +++ b/tests/test_cli_utils.py @@ -54,6 +54,8 @@ def test_lazy_choices_help(): getter = mock.getter getter.return_value = ['a', 'b', 'c'] + # Help formatter is only called when --help is used (lazy) + help_formatter = mock.help_formatter help_formatter.return_value = ''