Python and database unittests

Daniel daniel.watrous at gmail.com
Tue Aug 26 18:56:28 EDT 2008


Hey gordy,

Thanks for the reply.  I am actually using sqlite in part of my
application and I don't feel the need to stub that.  Even though I
don't use the in memory option, it is still zero configuration so I
build up my database in each test then delete it.

However, the way I interact with the MySQL database is different than
the sqlite portion.

Thanks again,
Daniel


On Aug 26, 4:12 pm, gordyt <gor... at gmail.com> wrote:
> Daniel I don't know if it would work for your situation or not, but if
> you are using Python 2.5, you could use the now built-in sqlite3
> module.  If you didn't even want to create a temporary database file
> you could use the special memory-only syntax like this:
>
> >>> import sqlite3
> >>> conn =sqlite3.connect(":memory:")
> >>> # use the connection
> >>> conn.close()
>
> --gordy




More information about the Python-list mailing list