There are many circumstances where it’s really great to display the output of a test while a test is running, and not wait until the end.
In this post, I’m going to describe my method for getting around pytest’s output capture mechanism, so that I can see my debug print/logging statements in real time.
Just pushed up an update to markdown.py and test_markdown_pytest.py to github
Passing first 3 tests now.
- Non-marked lines
- em tags
- strong tags
Update: I posted this, then felt bad that it was so short, so removed it.
However, a notification already had gone out on twitter and the rss feed.
So I moved it back to published.
I still fill bad that it’s so short.
But 404′s are worse.
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.
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