nose fixture reference

I’m going to cover nose setup and teardown fixtures at the package, module, class, method, and function level.
This isn’t about what code to put into the fixtures, just about the syntax and flow.
And a bit about naming conventions. [Read more…]

nose introduction

This post has several examples, and covers fixtures, test discovery, asserts, running options, and running unittests and doctests.

Nose’s tagline is “nose extends unittest to make testing easier”.
It’s is a fairly well known python unit test framework, and can run doctests, unittests, and “no boilerplate” tests.

[Read more…]

pytest introduction

I think of pytest as the run-anything, no boilerplate, no required api, use-this-unless-you-have-a-reason-not-to test framework.
This is really where testing gets fun.
As with previous intro’s on this site, I’ll run through an overview, then a simple example, then throw pytest at my project. I’ll also cover fixtures, test discovery, and running unittests with pytest.

[Read more…]

unittest introduction

The unittest test framework is python’s xUnit style framework.
It is a standard module that you already have if you’ve got python version 2.1 or greater.
In this post, I’ll cover the basics of how to create and run a simple test using unittest.
Then I’ll show how I’m using it to test

[Read more…]