def test_joke():One I have that in a file call test_joke.py,
py.test will pick it up and try to run it.
The good thing to have only this minimal code is that the test will fail if you happen to introduce a syntax error or some error in the module initialization.
Of course, when I have more time I beef up the tests ;)
What make it even more useful is a continuous integration system that run the tests every time someone checks in the code.