diff options
| -rw-r--r-- | coverage.ini | 2 | ||||
| -rw-r--r-- | src/mailman/bin/master.py | 11 | ||||
| -rw-r--r-- | src/mailman/bin/runner.py | 6 | ||||
| -rw-r--r-- | src/mailman/rest/users.py | 1 | ||||
| -rw-r--r-- | tox.ini | 2 |
5 files changed, 17 insertions, 5 deletions
diff --git a/coverage.ini b/coverage.ini index da390582a..ec0e846c7 100644 --- a/coverage.ini +++ b/coverage.ini @@ -5,7 +5,7 @@ omit = setup* */showme.py .tox/coverage/lib/python2.7/site-packages/* - + [paths] source = mailman diff --git a/src/mailman/bin/master.py b/src/mailman/bin/master.py index 2b3ec87c4..9eaec21b8 100644 --- a/src/mailman/bin/master.py +++ b/src/mailman/bin/master.py @@ -369,9 +369,16 @@ class Loop: args.extend(['-C', self._config_file]) log = logging.getLogger('mailman.runner') log.debug('starting: %s', args) - os.execl(*args) + # For the testing framework, if this environment variable is set, pass + # it on to the subprocess. + coverage_env = os.environ.get('COVERAGE_PROCESS_START') + if coverage_env is not None: + env = dict(COVERAGE_PROCESS_START=coverage_env) + args.append(env) + print('ARGS:', args, file=sys.stderr) + os.execle(*args) # We should never get here. - raise RuntimeError('os.execl() failed') + raise RuntimeError('os.execle() failed') def start_runners(self, runner_names=None): """Start all the configured runners. diff --git a/src/mailman/bin/runner.py b/src/mailman/bin/runner.py index 76da0364f..7648ed961 100644 --- a/src/mailman/bin/runner.py +++ b/src/mailman/bin/runner.py @@ -42,6 +42,12 @@ from mailman.version import MAILMAN_VERSION_FULL log = None +# Enable coverage if run under the appropriate test suite. +if os.environ.get('COVERAGE_PROCESS_START') is not None: + import coverage + coverage.process_startup() + + class ROptionAction(argparse.Action): """Callback for -r/--runner option.""" diff --git a/src/mailman/rest/users.py b/src/mailman/rest/users.py index 798fe699d..cfea36cfa 100644 --- a/src/mailman/rest/users.py +++ b/src/mailman/rest/users.py @@ -23,6 +23,7 @@ __metaclass__ = type __all__ = [ 'AUser', 'AllUsers', + 'Login', ] @@ -29,8 +29,6 @@ commands = usedevelop = True whitelist_externals = python-coverage deps = coverage -# Don't use --pre version packages. -install_command = pip install {opts} {packages} setenv = COVERAGE_PROCESS_START={[coverage]rcfile} COVERAGE_OPTIONS="-p" |
