Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnifiedAlchemyMagicMock should support execute #29

Open
ribeaud opened this issue Oct 30, 2019 · 2 comments
Open

UnifiedAlchemyMagicMock should support execute #29

ribeaud opened this issue Oct 30, 2019 · 2 comments

Comments

@ribeaud
Copy link

ribeaud commented Oct 30, 2019

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
Copy link
Author

ribeaud commented Nov 5, 2019

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

@miki725
Copy link
Owner

miki725 commented Nov 5, 2019

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants