alchemy-mock icon indicating copy to clipboard operation
alchemy-mock copied to clipboard

UnifiedAlchemyMagicMock should support execute

Open ribeaud opened this issue 4 years ago • 2 comments

Using session, it is possible to execute plain SQL calls with execute method:

session.execute("select count(*) as count from my_table").fetchone[0]

I did not find out how I could mock such scenarios with UnifiedAlchemyMagicMock. Did I oversee something?

ribeaud avatar Oct 30 '19 10:10 ribeaud

Sorry to insist... But is there any workaround to overcome such cases?

ribeaud avatar Nov 05 '19 12:11 ribeaud

you can mock a session with regular AlchemyMagicMock. unified is meant to mimick orm where you interface with models. not sure how useful that will be to add support there for execute as there is nothing to unify (e.g. there is no need to call execute() multiple times where the params need to be merged).

miki725 avatar Nov 05 '19 12:11 miki725