a skeleton for unittests and tables

Issue #1250 resolved
Former user created an issue

It would be good to have a skeleton for unittests and for sqlalchemy classes.

I just made a similar proposal to the Elixir team: - http://elixir.ematia.de/trac/attachment/ticket/80/test_skeleton.py - http://elixir.ematia.de/trac/ticket/80 however, I am not very expert with sqlalchemy, so I can't propose any file to you.

These skeletons would be very good examples for newbies, to understand how sqlalchemy works and how to implement tests and tables with it. I suggest you to use both doctest and unittest.

Comments (4)

  1. Mike Bayer repo owner

    agree (except perhaps for the unittest part). We have some patterns in SQLA's own unit tests that I would say are probably too cumbersome for many situations (i.e. create/drop everything using setUpAll/tearDownAll). The better pattern for end-user testing is the one you're doing, that of rolling back a transaction after the test is complete. Still, a setUpAll/tearDownAll step is very useful and this is something unittest does not support (we have hacked our own version of unittest), so you should consider standardizing on nose which is already more widely used.

  2. Former user Account Deleted

    I didn't know of nose! Well, as you wish... but if you suggest to all users to use another testing framework than the standard one (in the sense that unittest is included in the standard libraries), please say so in the documentation, or it will be confusing.

  3. Log in to comment