You simply need to install pytest-cov and call py.test with the --cov option