Well obviously you could mock it. A few years back Jason wrote a statement "recorder/replayer" which can simulate a DBAPI receiving/returning an exact series of statements/results, it involves first recording the database interaction into memory and specifically is not for mocking, though I wonder if the idea could be adapted somehow. That's in our source tree under test/lib/engines/ReplayableSession.
Usually for testing I use a real DB and just run the tests in a transaction that's rolled back. This approach works very well, and is described at http://www.sqlalchemy.org/docs/orm/session.html#joining-a-session-into-an-external-transaction . On Jan 17, 2011, at 12:29 AM, Eric Lemoine wrote: > Hello > > For testing purposed I'd like to do query.all(). query.get() and > query.count() with no actual communication with the DBMS. Is this > possible? > > Thanks a lot, > > -- > Eric Lemoine > > Camptocamp France SAS > Savoie Technolac, BP 352 > 73377 Le Bourget du Lac, Cedex > > Tel : 00 33 4 79 44 44 96 > Mail : eric.lemo...@camptocamp.com > http://www.camptocamp.com > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.