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

[question] Why is session.bind set to engine? Excessive savepoints? #45

Open
repole opened this issue Feb 16, 2021 · 0 comments
Open

[question] Why is session.bind set to engine? Excessive savepoints? #45

repole opened this issue Feb 16, 2021 · 0 comments

Comments

@repole
Copy link

repole commented Feb 16, 2021

I'm primarily using the db_session fixture, and I've noticed that my tests are creating savepoints at seemingly every database interaction. Trying to narrow things down, I noticed that commenting out this line seems to remove all but the outermost savepoint.

https://github.com/jeancochrane/pytest-flask-sqlalchemy/blob/master/pytest_flask_sqlalchemy/fixtures.py#L150

Trying to understand all of the logic here to make sure any tinkering I'm doing doesn't mess up any fundamental things here. What is the reasoning for setting session.bind = engine here, when it's already been previously bound to a nested transaction?

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

1 participant