summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2014-11-16 16:28:05 -0500
committerBarry Warsaw2014-11-16 16:28:05 -0500
commita7d5b481c47e561ee3e27bae262e6722420f847a (patch)
tree02893c625e4c1d14bda8023cd7e1ffb039b1faad
parent26fe2c0d37d4da51dbda077cdf46a4cd6cec22a5 (diff)
downloadmailman-a7d5b481c47e561ee3e27bae262e6722420f847a.tar.gz
mailman-a7d5b481c47e561ee3e27bae262e6722420f847a.tar.zst
mailman-a7d5b481c47e561ee3e27bae262e6722420f847a.zip
-rw-r--r--coverage.ini2
-rw-r--r--src/mailman/bin/master.py11
-rw-r--r--src/mailman/bin/runner.py6
-rw-r--r--src/mailman/rest/users.py1
-rw-r--r--tox.ini2
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',
]
diff --git a/tox.ini b/tox.ini
index 803e8da37..d4a01fc12 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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"