[sqlalchemy] idle in transaction using ZopeTransactionExtension with postgres

2015-02-26 Thread Robert Daniels
I'm using ZopeTransactionExtension (postgresql) as: DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))Base = declarative_base() When I invoke result = DBSession.execute("some sql query") The result comes back fine, however I notice when I review the server statu

[sqlalchemy] How to load sql file during unit test

2015-02-04 Thread Robert Daniels
I thought this would be easy to Google, but could not find anything. Using pyramid+sqlalchemy+postgres. I'm doing some unit tests and I have a large sql file that contains my db schema. The goal is to have the unit test create and populate the database with test data, run the tests, then remove