Pytest plugin: Overriding pytest_runtest_call and friends
<p>I'm developing a test suite using pytest for a project of mine. Because of the nature of the project, I need to create a Pytest plugin that controls how the tests are being run; they are not run locally, but sent to a different process to run. (I know about <code>xdist</code> but I think it doesn't solve my problem.)</p>

<p>I've been writing my own Pytest plugin by overriding the various <code>pytest_runtest_*</code> methods. So far it's been progressing well. Here is where I've hit a wall: I want my implementations of <code>pytest_runtest_setup</code>, <code>pytest_runtest_call</code> and <code>pytest_runtest_teardown</code> to actually be responsible for doing the setup, call and teardown. They're going to do it in a different process. <strong>My problem is:</strong> After Pytest calls my <code>pytest_runtest_setup</code>, it also calls all the other <code>pytest_runtest_setup</code> down the line of plugins. This is because the hook specification for <code>pytest_runtest_setup</code> has <code>firstresult=False</code>.</p>

<p>I don't want this, because I don't want <code>pytest_runtest_setup</code> to actually run on the current process. I want to be responsible for running it on my own. I want to <strong>override</strong> how it's being run, not <strong>add</strong> to it. I want the other implementations of <code>pytest_runtest_setup</code> below my own to <strong>not</strong> be run.</p>

<p>How can I do this? </p>