On 04/06/2019 23:21, Mike Bayer wrote:


I'm not following all your code but if there are two sessions in play I'd probably try to avoid that, there should be only one Session you care about.

This comes back to something I asked you about on Twitter a while ago: the code under test gets its session by calling a sessionmaker; how can I have that return an existing session, which appears to be what you're suggesting, rather than a new suggestion, which appears to be all they can do.

the test fixtures should be external to everything

I don't understand what you mean by this.

and make sure there's just the one session.   if there are two in play, I'm not sure how they both get bound to your test transaction.

I believe they start a nested transaction?

Chris

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/50bb9529-f98b-24aa-484f-1274c8fe3290%40withers.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to