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.
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 markdown.py project. I’ll also cover fixtures, test discovery, and running unittests with pytest.
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 markdown.py.
Well, the poll I put up a couple weeks ago has 125 votes last I checked.
- nose, 42 votes
- pytest, 32 votes
- unittest, 29 votes
- doctest, 18 votes
- other, 4 votes
The other votes were:
- twisted trial (also mentioned in a comment)
This is mostly what I expected.
So I think I’m on the Continue reading