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.
Search and replace is such a common task that it should be a tool that’s in every command line script author’s toolbox.
There are probably endless solutions to the problem.
I’ve put together my standard methods for tackling the problem.
I’ll also show similar Perl versions, mainly for comparisons.
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.
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.