nose works by running python files and methods that contain the word 'test',
some people use nose to call their UnitTest objects. But you don't have to
do this, you can get up to speed by using assert x == y for example.

As 1 possible implementation, you can have setup() method in your test file
that repopulate your database to initial state.

Then, every time test_xyz() method is called, call setup() first.

Beyond unit testing, if you are curious on how fast your ORM methods is,
checkout timeit and hotshot.

See:

http://docs.python.org/library/unittest.html
http://pylonsbook.com/en/1.0/testing.html
http://docs.python.org/library/timeit.html
http://docs.python.org/library/hotshot.html

- Didip -

On Thu, Aug 13, 2009 at 10:22 AM, AF <allen.fow...@yahoo.com> wrote:

>
> Hello,
>
> I'm writing a basic SQLAlchemy application, and have started to
> explore the concept of unit testing in general and specifically with
> nose.
>
> Since I am new to both SQLAlchey and nose, I do not know where to
> start.
>
> Right now the app is at the point where:
>
> 1) The tables are defined with declarative base.
>
> 2) I've made a few functions to populate the database from a series of
> source data files. (The data files are text, but are an odd "almost
> csv" format.)
>
> 3) I've made a few functions to dump the database back to these data
> files.
>
> So now, I would like to construct a series of tests to ensure the
> database is really being populated correctly based on sample data
> files.  (And that the database can be correctly saved back out to
> these data files.)
>
> Do you have any suggestions / tutorials you can point me towards?
>
>
> Thank you,
> :)
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to