From 3534522e03a260fdef200a018c9043c7ccfb5f53 Mon Sep 17 00:00:00 2001 From: Blaine Jester Date: Thu, 9 Nov 2023 12:34:12 -0800 Subject: [PATCH] Define __name__ --- kolibri/core/test/test_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kolibri/core/test/test_utils.py b/kolibri/core/test/test_utils.py index 8d5290cf54d..986afb20417 100644 --- a/kolibri/core/test/test_utils.py +++ b/kolibri/core/test/test_utils.py @@ -68,6 +68,7 @@ def test_retry_on_db_lock__no_handling_unless_sqlite(self): from sqlite3 import OperationalError func = mock.MagicMock() + func.__name__ = "test_func" func.side_effect = [OperationalError("database is locked"), True] wrapped = retry_on_db_lock(func) with self.assertRaises(OperationalError): @@ -89,6 +90,7 @@ def test_retry_on_db_lock__retry(self): from sqlite3 import OperationalError func = mock.MagicMock() + func.__name__ = "test_func" func.side_effect = [OperationalError("database is locked"), True] wrapped = retry_on_db_lock(func) result = wrapped() @@ -103,6 +105,7 @@ def test_retry_on_db_lock__retry__maximum_attempts(self): from sqlite3 import OperationalError func = mock.MagicMock() + func.__name__ = "test_func" func.side_effect = [OperationalError("database is locked")] * 6 wrapped = retry_on_db_lock(func) with self.assertRaises(OperationalError):