Relative Content

Tag Archive for python-3.xunit-testingsqlalchemy

Mocking SQLAlchemy Result Returns

I am writing unit tests for testing querying a database using SQLAlchemy. I seem to have the mocks setup correctly to mock the create_engine, connection, execute, and all methods for the query, the results return with the proper return value in the .all() return, but it should be a two dimensional list, but it keeps returning the Mock object itself instead of the return_value.