diff --git a/src/octoprint/plugin/__init__.py b/src/octoprint/plugin/__init__.py index 590bc5d8b..7ea1f379b 100644 --- a/src/octoprint/plugin/__init__.py +++ b/src/octoprint/plugin/__init__.py @@ -744,3 +744,6 @@ class PluginSettings: Removes all data stored for this plugin. """ self.settings.remove(self._prefix_path()) + + def __getattr__(self, item): + return getattr(self.settings, item) diff --git a/tests/plugin/test_settings.py b/tests/plugin/test_settings.py index 5aa86e34f..6d5a3d428 100644 --- a/tests/plugin/test_settings.py +++ b/tests/plugin/test_settings.py @@ -372,3 +372,10 @@ def test_logfile_path_with_postfix(plugin_settings, settings): settings.getBaseFolder.assert_called_once_with("logs") assert f"/some/folder/plugin_{plugin_key}_mypostfix.log" == path.replace(os.sep, "/") + + +def test_unhandled_method(plugin_settings): + with pytest.raises( + AttributeError, match="Mock object has no attribute 'some_method'" + ): + plugin_settings.some_method("some_parameter")