testing schevo+pylons apps

by gldnspud on December 6, 2006

Note: This is based on a development version of the SchevoWsgi package.

I needed a way to get to an in-memory Schevo database that would be created from scratch every time a functional unit test ran in a Pylons application.

So I added a memory:// URI type to SchevoWsgi's dbopener middleware.

To use it in a Pylons application, make sure you already have a development.ini file that is designed to work with Schevo. Then copy it to testing.ini and change the [filter:dbopener] section to use an in-memory database instead:

[filter:dbopener]
use = egg:SchevoWsgi#dbopener
schevo.db.db = memory://yourapp.schema/1
verbose = true

Change the loadapp line in yourapp/tests/__init__.py to read as follows:

loadapp('config:testing.ini', relative_to=conf_dir)

Comments on this entry are closed.

Previous post:

Next post: