[sqlalchemy] Re: Unit testing with SA?

2007-02-07 Thread Allen Bierbaum
I have taken a quick look at this code. But be warned I have not actually used it yet so I have limited real experience with it... Overall it looks very interesting. I was expecting something much more along the vein of DbUnit where you do something like this: setUp(): dataset =

[sqlalchemy] Re: Unit testing with SA?

2007-02-07 Thread Allen Bierbaum
I am going to try to integrate this into my testing framework this afternoon so I am sure I will have more questions after that. In the meantime see below... On 2/7/07, Kumar McMillan [EMAIL PROTECTED] wrote: Thanks for taking a close look Allen. Here are some answers... On 2/7/07, Allen

[sqlalchemy] Re: Unit testing with SA?

2007-02-07 Thread Kumar McMillan
db = SQLAlchemyFixture() # anytime before db.data().setup() ... db.session = my_session In my current system I have a single global session that is used for everything. Is there any reason you can see that I could not just reuse this session in all the test cases or should I be

[sqlalchemy] Re: Unit testing with SA?

2007-02-03 Thread sdobrev
There is more; to have really independent tests u have to destroy all SA caches and mappers etc. metadata.drop_all() clear_mappers() db.dispose() and always let ALL sessions etc fall out of scope. Make sure u do not store exception contexts, nor any persistent objects between the tests.

[sqlalchemy] Re: Unit testing with SA?

2007-02-02 Thread Christopher Arndt
Allen schrieb: How do people writing db applications with SA do unit testing on their code? Are there any good db unit testing frameworks that work well with SA? If I can't find anything I will probably just roll my own but I would like to keep from reinventing the wheel if I can help it.