def test_show_method_help(capsys: CaptureFixture, plugin: MockPlugin | type[MockPlugin]): """Same help as when called directly. Note: help differs when called on class.method vs. instance.method """ help(plugin.some_method) original_help, _ = capsys.readouterr() show_method_help(plugin, "some_method") result, _ = capsys.readouterr() assert "This docstring is just for help testing of 'some_method'." in result assert result == original_help
def show_data_io_method_help( format_name: str, method_name: Literal["load_dataset", "save_dataset"] ) -> None: """Show help for the implementation of data io plugin methods. Parameters ---------- format_name : str Format the method should support. method_name : {'load_dataset', 'save_dataset'} Method name """ io = get_data_io(format_name) show_method_help(io, method_name)
def show_project_io_method_help(format_name: str, method_name: ProjectIoMethods) -> None: """Show help for the implementation of project io plugin methods. Parameters ---------- format_name : str Format the method should support. method_name : {'load_model', 'write_model', 'load_parameters', 'write_parameters',\ 'load_scheme', 'write_scheme', 'load_result', 'write_result'} Method name. .. # noqa: DAR103 method_name .. # noqa: DAR101 """ io = get_project_io(format_name) show_method_help(io, method_name)