Re: [sqlalchemy] Trying to get tables to be created by unit tests

2014-08-12 Thread alchemy1
DBSession is like this (not even sure if I need to do it this way, just following the examples) DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension ())) If change to bind=connection self.session = DBSession(bind=connection) then I get an error

Re: [sqlalchemy] Trying to get tables to be created by unit tests

2014-08-12 Thread alchemy1
I've tried to simplify the code but it still isn't working: from sqlalchemy.orm import scoped_session, sessionmaker from zope.sqlalchemy import ZopeTransactionExtension DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension ())) engine =

Re: [sqlalchemy] Trying to get tables to be created by unit tests

2014-08-12 Thread Michael Bayer
On Aug 12, 2014, at 7:26 AM, alchemy1 veerukrish...@hotmail.com wrote: I've tried to simplify the code but it still isn't working: from sqlalchemy.orm import scoped_session, sessionmaker from zope.sqlalchemy import ZopeTransactionExtension DBSession =

[sqlalchemy] Trying to get tables to be created by unit tests

2014-08-11 Thread alchemy1
I have combined several examples I've found to try to get the 'transactional-style' of unit tests to work, where you roll back the database after each test. However when I run this, the test fails when trying to insert the object with DBSession.add, complaining that the tables don't exist. I

Re: [sqlalchemy] Trying to get tables to be created by unit tests

2014-08-11 Thread Mike Bayer
On 08/11/2014 04:37 PM, alchemy1 wrote: I have combined several examples I've found to try to get the 'transactional-style' of unit tests to work, where you roll back the database after each test. However when I run this, the test fails when trying to insert the object with DBSession.add,