nose-devs/nose — pull request #850 by bluca (2014-09-28 17:40:20+00:00)
Title: Added MultiProcess plugin API for registering callbacks to be run at sta...

Hello,

This patch adds support for MultiProcess plugin worker processes to execute callbacks at start and/or stop. The callbacks can be registered (including args) via two new APIs.

The use-case we had was some worker-specific setup requirement which was very slow and error prone, and we wanted to have some resilience in case one failed. The normal test class setUp() could not be used effectively because it is executed when the worker already pulled a test from the Queue, which means in case of catastrophic failure that test would be lost. But thanks to this callback, if a worker process dies horribly the others can carry on and all the tests are run.

(Disclaimer: this work was done while at Cisco Systems LTD and all the required authorizations for pushing upstream were obtained through the internal open source patch channel)