Ticket #80 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

a skeleton for test units

Reported by: guest Owned by:
Priority: normal Milestone:
Component: documentation Version:
Keywords: test, skeleton, example Cc:

Description

I suggest you to add, in the examples page, a skeleton for test units. It would help people understanding how elixir works and make it easier to write tests. For example, the first time I have tried, I lost a lot of time trying to understand where to put 'session.clear' and 'session.commit', etc. and how to test exceptions.

I am attaching a short skeleton I wrote for myself (it uses both unittest and doctest), but you can probably design a better one.

Attachments

test_skeleton.py (1.3 kB) - added by guest 4 years ago.
A skeleton for testing units in Elixir

Change History

Changed 4 years ago by guest

A skeleton for testing units in Elixir

Changed 4 years ago by guest

  • keywords test, skeleton, example added
  • priority changed from blocker to normal

Changed 4 years ago by ged

  • status changed from new to closed
  • resolution set to fixed

Done at in the Recipes page. I've done some changes to your code though. Thanks for the idea & code.

http://elixir.ematia.de/trac/wiki/Recipes/Testing

Changed 4 years ago by guest

So you do setup_all only once, and put session.close and drop_all in tearDown. Great, that is what I wanted to know.

Cheers :)

Note: See TracTickets for help on using tickets.