Skip to content

Commit

Permalink
Define __name__
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed Nov 9, 2023
1 parent 2fcfde2 commit 3534522
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kolibri/core/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 3534522

Please sign in to comment.