pytest-flask-sqlalchemy
pytest-flask-sqlalchemy copied to clipboard
Adding MySQL support for db fixtures
Adding MySQL (tested on 5.7) support with updated tests. The travis config was updated to support testing on multiple databases. I will try to tackle SQLite next.
NOTE: I skip the drop table tests for MySQL engines because the DROP TABLE ...
statement causes an autocommit, which breaks what the test was trying to assert. After scratching my head quite a lot I found these in the MySQL docs: https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html
"[
DROP TABLE
statements] cause an implicit commit after executing. The intent is to handle each such statement in its own special transaction because it cannot be rolled back anyway."
If anybody thinks I have misunderstood, I'll gladly take the lesson!
Refs https://github.com/jeancochrane/pytest-flask-sqlalchemy/issues/3 (kinda)
Thanks for opening this @kamikaz1k! I'll have some time to give it a review on Saturday.
Hey @kamikaz1k! Any progress on this recently?
@jeancochrane sorry, I might have misunderstood. I thought you were going to confirm my findings about MySQL behaviour for Table/Transactions. Or did you just mean I should make updates to the README?
Sorry @kamikaz1k, I lost the context for this PR and forgot that the ball was in my court. I'll have some time to take a closer look soon.
Hey @jeancochrane, just wondering if you made a decision around this PR/MySQL support.
My company just started switching over our applications to use pytest, and I was hoping to use this addon in our new setup :)