I\'ve been pulling my hair out trying to figure out how to mock the sqlite3.Cursor class specifically the fetchall method.
sqlite3.Cursor
fetchall
Consider the followi
I have found a way to mock sqlite3.Cursor in my tests:
cursor = MagicMock(Cursor) cursor.fetchall.return_value = [{'column1': 'hello', 'column2': 'world'}]
I am pretty new in python but this is how I do it in Java.