[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread Michael Bayer
On Jan 23, 2008, at 5:00 PM, Kumar McMillan wrote: Hello, I have not been able to figure this out from the docs. I would like to setup and teardown test data using mapped classes. The problem is that those same mapped classes need to be used by the application under test and in case there

[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread Kumar McMillan
Hi On Jan 23, 2008 4:07 PM, Michael Bayer [EMAIL PROTECTED] wrote: your teardown code can't have any dependencies on the test code itself. So at the very least start the teardown phase with PrivateSession.close() so that you start fresh. I tried adding that to the teardown code but then

[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread jason kirtland
Kumar McMillan wrote: Hello, I have not been able to figure this out from the docs. I would like to setup and teardown test data using mapped classes. The problem is that those same mapped classes need to be used by the application under test and in case there is an error, the teardown

[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread Kumar McMillan
On Jan 23, 2008 4:36 PM, Kumar McMillan [EMAIL PROTECTED] wrote: ...but it still fails with the same error, Deleted rowcount 0 does not match number of objects deleted 1. What am I missing? I don't understand how the teardown code is dependent on the app code if it is using a different

[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread svilen
apart of all runtime issues u've hit - session etc - on declaration level u'll may do these: - destroy all your refs to the mappers/tables etc - sqlalchemy.orm.clearmappes() - yourmetadata.drop_all() - yourengine.dispose() - destroy refs to yourmetadata/yourengine