nose-devs/nose — pull request #748 by silasray (2013-11-21 20:06:03+00:00)
Title: stopWorker plugin hook to allow plugins to specify behaviors on exit from multiprocess workers

Added a stopWorker plugin hook. I'm developing a plugin that needs to perform cleanup when exiting worker threads. I thought about just reusing finalize, but concluded that a new and distinct hook would be more flexible. finalize also takes a result, which would mean more refactoring of __runner to compose all results of tests run in the worker in to a single result. finalize also has implications of impacting result rollup and reporting, but it seems like that should be left to the master thread, whereas stopWorker is solely concerned with closing any resources the plugin may have opened in the worker.

On a more minor note, I also added a self.sort() to the plugins.manager.PluginManager.configure() before the plugins' configure methods are called, to make sure configure is called according to plugin priority. I did this primarily to ensure that any plugins which may be relying on the state of the multiprocess plugin to configure themselves are configured in a temporally consistent manner with respect to the multiprocess plugin.