pytest-flask-sqlalchemy icon indicating copy to clipboard operation
pytest-flask-sqlalchemy copied to clipboard

Adding MySQL support for db fixtures

Open kamikaz1k opened this issue 6 years ago • 5 comments

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)

kamikaz1k avatar Jan 04 '19 03:01 kamikaz1k

Thanks for opening this @kamikaz1k! I'll have some time to give it a review on Saturday.

jeancochrane avatar Jan 04 '19 13:01 jeancochrane

Hey @kamikaz1k! Any progress on this recently?

jeancochrane avatar Feb 20 '19 22:02 jeancochrane

@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?

kamikaz1k avatar Feb 23 '19 19:02 kamikaz1k

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.

jeancochrane avatar Feb 26 '19 00:02 jeancochrane

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

kamikaz1k avatar Sep 30 '19 04:09 kamikaz1k