Under some conditions, py.test fails to call teardown_module. This can break subsequent test runs.
Consider this contrived example:
def setup_module(mod): launch_foo_daemon() x = 0/0 # Provoke an exception
def teardown_module(mod): stop_foo_daemon()
When py.test runs this code, it will call setup_module, but will fail to call teardown_module. This is an error. It leaves the foo daemon running in the background, which will interfere with subsequent test runs.
py.test should call teardown_module even if setup_module fails.