Achoo - Testing You Can Believe In

I've just released Achoo 1.0 over at Quuxo, a new library for testing properties and behaviour of Python objects in unit tests. It has a fluent-style API, much like how Fest Assert works in Java.

The unittest (nee PyUnit) module as shipped with Python is reasonable for running unit tests, but it has two different assertion APIs. One generates failure messages for you automatically, but is quite baroque and requires annoying mental gymnastics when using and reading it. The other is a bit more sane, but doesn't generate useful assertion messages for you. Neither cover many different types of assertions you might want to make. All in all, it is pretty annoying.

At work, we have been using Fest Assert (/me waives at Levi). While JUnit's API for making assertions is a lot less painful than PyUnit's and while I think Fest is probably a bit too verbose, as is the fashion for Java APIs, it sill does make testing code easier to read. I think that must have put me onto Martin Fowler's article Fluent Interfaces, which I recently read and which pretty well describes Fest Assert. It's interesting, go read it.

So, the other day I was writing some tests using PyUnit and fuming about this whole thing yet again. The confluence of that, using Fest and Fowler's article led me to create Achoo. It is approximately three billion times nicer than using unittest.TestCase's assertion methods, makes your tests easier to read (by about the same order of magnitude) and generates useful error messages. It's awesome, and it is free software. Check it out, submit patches, enjoy.