Re: [sqlalchemy] Unit testing, mocking and dependency injection with SA Declarative.

2013-09-12 Thread James C
Regarding the Postgres in production and SQLite in testing differences, we've previously had problems with Postgres's Array - which doesn't exist in SQLite. Also watch out for the differences between how they interpret GROUP BY and DISTINCT - I've had this problem only today where a

Re: [sqlalchemy] Unit testing, mocking and dependency injection with SA Declarative.

2013-09-11 Thread Ladislav Lenart
However, be aware of differences between PostgreSQL and sqlite. For example sqlite does not support recursive CTEs. But I am sure there's more. Ladislav Lenart On 10.9.2013 18:43, Toph Burns wrote: Could you use an in-memory, sqlite db for your testing? For our applications, we have an

Re: [sqlalchemy] Unit testing, mocking and dependency injection with SA Declarative.

2013-09-11 Thread Alex Grönholm
I wrote a blog post on this very topic recently: http://alextechrants.blogspot.fi/2013/08/unit-testing-sqlalchemy-apps.html tiistai, 10. syyskuuta 2013 19.43.35 UTC+3 Toph Burns kirjoitti: Could you use an in-memory, sqlite db for your testing? For our applications, we have an

Re: [sqlalchemy] Unit testing, mocking and dependency injection with SA Declarative.

2013-09-10 Thread Michael Bayer
you want to mock the entire relational database at the engine level? that sounds kind of tough?you should mock at the highest level possible in order to test the actual code you're testing.unles you're testing that select * from table returns what you expect, I'm not sure you'd be

RE: [sqlalchemy] Unit testing, mocking and dependency injection with SA Declarative.

2013-09-10 Thread Toph Burns
Could you use an in-memory, sqlite db for your testing? For our applications, we have an initialization function that loads the database connection strings from a config (.ini) file, passing those on to create_engine. In production it's a postgresql connection string, for test, it's a