~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to src/mailman/bin/master.py

  • Committer: Barry Warsaw
  • Date: 2014-11-16 21:28:05 UTC
  • Revision ID: barry@list.org-20141116212805-vizrba3y5s39z0r4
Make sure runner subprocesses get covered during `tox -e coverage`.

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
            args.extend(['-C', self._config_file])
370
370
        log = logging.getLogger('mailman.runner')
371
371
        log.debug('starting: %s', args)
372
 
        os.execl(*args)
 
372
        # For the testing framework, if this environment variable is set, pass
 
373
        # it on to the subprocess.
 
374
        coverage_env = os.environ.get('COVERAGE_PROCESS_START')
 
375
        if coverage_env is not None:
 
376
            env = dict(COVERAGE_PROCESS_START=coverage_env)
 
377
            args.append(env)
 
378
        print('ARGS:', args, file=sys.stderr)
 
379
        os.execle(*args)
373
380
        # We should never get here.
374
 
        raise RuntimeError('os.execl() failed')
 
381
        raise RuntimeError('os.execle() failed')
375
382
 
376
383
    def start_runners(self, runner_names=None):
377
384
        """Start all the configured runners.