Pyunit

One of the things I like about JUnit 4 is to see anotations replace the naming convention required by earlier versions. I like the declarative approach so much, in fact, that I’ve extended pyunit (the standard python unit testing framework) with some simple hacks that yield the same syntax. By including the pyunit2.py module, you can now write your test methods like this:

@test
@expected_exception( NameError )
def a_simple_example_test( self ): #...etc

The module's gone up on aspn for posterity. You'll find it here.

511475
Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s