From 2801da5c51a46ad6cbf31441bed558aff60632f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 26 Nov 2019 16:22:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Fix=20unit=20tests=20by=20fixing?= =?UTF-8?q?=20mocked=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3348 --- tests/plugin/test_settings.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/plugin/test_settings.py b/tests/plugin/test_settings.py index 3fa3f696c..aa267c5c8 100644 --- a/tests/plugin/test_settings.py +++ b/tests/plugin/test_settings.py @@ -105,7 +105,11 @@ class SettingsTestCase(unittest.TestCase): def test_deprecated_forwarded_getter(self, deprecated, current, forwarded): with warnings.catch_warnings(record=True) as w: called_method = getattr(self.settings, forwarded) + + # further mock out our mocked function so things work as they should called_method.__name__ = to_native_str(forwarded) + called_method.__qualname__ = to_native_str(forwarded) + called_method.__annotations__ = dict() method = getattr(self.plugin_settings, deprecated) self.assertTrue(callable(method)) @@ -169,7 +173,11 @@ class SettingsTestCase(unittest.TestCase): def test_deprecated_forwarded_setter(self, deprecated, current, forwarded, value): with warnings.catch_warnings(record=True) as w: called_method = getattr(self.settings, forwarded) + + # further mock out our mocked function so things work as they should called_method.__name__ = to_native_str(forwarded) + called_method.__qualname__ = to_native_str(forwarded) + called_method.__annotations__ = dict() method = getattr(self.plugin_settings, deprecated) self.assertTrue(callable(method))