def poolRunner(target, queue, coverage_number=None, omit_patterns=[], cov_config_file=True):  
<EOL>saved_tempdir = tempfile.tempdir<EOL>tempfile.tempdir = tempfile.mkdtemp()<EOL>def cleanup():<EOL><INDENT>if sys.version_info[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>shutil.rmtree(tempfile.tempdir, ignore_errors=True)<EOL><DEDENT>tempfile.tempdir = saved_tempdir<EOL>queue.put(None)<EOL>if coverage_number:<EOL><INDENT>cov.stop()<EOL>cov.save()<EOL><DEDENT><DEDENT>if coverage_number:<EOL><INDENT>cov = coverage.coverage(<EOL>data_file='<STR_LIT>'.format(<EOL>coverage_number, random.randint(<NUM_LIT:0>, <NUM_LIT>)),<EOL>omit=omit_patterns,<EOL>config_file=cov_config_file)<EOL>cov._warn_no_data = False<EOL>cov.start()<EOL><DEDENT>already_sent = set()<EOL>def start_callback(test):<EOL><INDENT>test = proto_test(test)<EOL>if test not in already_sent:<EOL><INDENT>queue.put(test)<EOL>already_sent.add(test)<EOL><DEDENT><DEDENT>def finalize_callback(test_result):<EOL><INDENT>queue.put(test_result)<EOL><DEDENT>result = ProtoTestResult(start_callback, finalize_callback)<EOL>test = None<EOL>try:<EOL><INDENT>loader = GreenTestLoader()<EOL>test = loader.loadTargets(target)<EOL><DEDENT>except:<EOL><INDENT>err = sys.exc_info()<EOL>t             = ProtoTest()<EOL>t.module      = '<STR_LIT>'<EOL>t.class_name  = '<STR_LIT>'<EOL>t.description = '<STR_LIT>'<EOL>t.method_name = '<STR_LIT>'<EOL>result.startTest(t)<EOL>result.addError(t, err)<EOL>result.stopTest(t)<EOL>queue.put(result)<EOL>cleanup()<EOL>return<EOL><DEDENT>if getattr(test, '<STR_LIT>', False):<EOL><INDENT>try:<EOL><INDENT>test.run(result)<EOL>if result and (not result.finalize_callback_called) and getattr(result, '<STR_LIT>', False):<EOL><INDENT>queue.put(test)<EOL>queue.put(result)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>if result.errors:<EOL><INDENT>queue.put(result)<EOL><DEDENT>else:<EOL><INDENT>err = sys.exc_info()<EOL>result.startTest(test)<EOL>result.addError(test, err)<EOL>result.stopTest(test)<EOL>queue.put(result)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>description = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(target, str(test), type(test), dir(test))<EOL>)<EOL>err = (TypeError, TypeError(description), None)<EOL>t             = ProtoTest()<EOL>target_list = target.split('<STR_LIT:.>')<EOL>t.module      = '<STR_LIT:.>'.join(target_list[:-<NUM_LIT:2>]) if len(target_list) > <NUM_LIT:1> else target<EOL>t.class_name  = target.split('<STR_LIT:.>')[-<NUM_LIT:2>] if len(target_list) > <NUM_LIT:1> else '<STR_LIT>'<EOL>t.description = description<EOL>t.method_name = target.split('<STR_LIT:.>')[-<NUM_LIT:1>] if len(target_list) > <NUM_LIT:1> else '<STR_LIT>'<EOL>result.startTest(t)<EOL>result.addError(t, err)<EOL>result.stopTest(t)<EOL>queue.put(result)<EOL><DEDENT>cleanup()<EOL>
I am the function that pool worker processes run.  I run one unit test.

coverage_config_file is a special option that is either a string specifying
the custom coverage config file or the special default value True (which
causes coverage to search for it's standard config files).