Are there any database testing tools for python (e.g. sqlunit)?

Are there any database testing tools for python (e.g. sqlunit)? I want to check DAL, which is built using sqlalchemy

+4
source share
1 answer

Follow the design pattern that Django uses.

  • Create a one-time copy of the database. For example, use SQLite3 in memory.

  • Create the database using SQLAlchemy tables and index definitions. This should be a pretty trivial exercise.

  • Download the test database to the database.

  • Run your unit test case in a database with a known, specific state.

  • Dispose of the database.

If you are using SQLite3 in memory, this procedure can be quite fast.

+4
source

All Articles