Pytest: run a function at the end of the tests : <p>I would like to run a function at the end of <strong>all</strong> the tests.</p>

<p>A kind of global teardown function.</p>

<p>I found an example <a href="https://gist.github.com/inklesspen/4555229" rel="noreferrer">here</a> and some clues <a href="http://doc.pytest.org/en/latest/fixture.html" rel="noreferrer">here</a> but it doesn't match my need. It runs the function at the beginning of the tests. I also saw the function <code>pytest_runtest_teardown()</code>, but it is called after each test.</p>

<p>Plus: if the function could be called only if all the tests passed, it would be great.</p>
