diff options
| author | Barry Warsaw | 2009-01-16 21:04:21 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-16 21:04:21 -0500 |
| commit | ae3d0cc316b826b8325507d960ccf84da601c3b0 (patch) | |
| tree | 3485e2ca463c2131a0ffb1693bc60d569cc9d8b7 /mailman/testing/layers.py | |
| parent | a3f7d07c62b2f7d6ac9d0b700883826c2838db60 (diff) | |
| download | mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.tar.gz mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.tar.zst mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.zip | |
Diffstat (limited to 'mailman/testing/layers.py')
| -rw-r--r-- | mailman/testing/layers.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mailman/testing/layers.py b/mailman/testing/layers.py index f3a4266fd..19300ba1e 100644 --- a/mailman/testing/layers.py +++ b/mailman/testing/layers.py @@ -17,6 +17,8 @@ """Mailman test layers.""" +from __future__ import absolute_import, unicode_literals + __metaclass__ = type __all__ = [ 'ConfigLayer', @@ -31,7 +33,6 @@ import logging import tempfile from pkg_resources import resource_string -from string import Template from textwrap import dedent from mailman.config import config @@ -39,6 +40,7 @@ from mailman.core import initialize from mailman.core.logging import get_handler from mailman.i18n import _ from mailman.testing.helpers import SMTPServer +from mailman.utilities.string import expand NL = '\n' @@ -105,11 +107,11 @@ class ConfigLayer: # If stderr debugging is enabled, make sure subprocesses are also # more verbose. if cls.stderr: - test_config += Template(dedent(""" + test_config += expand(dedent(""" [logging.$name] propagate: yes level: debug - """)).substitute(name=sub_name, path=path) + """), dict(name=sub_name, path=path)) # zope.testing sets up logging before we get to our own initialization # function. This messes with the root logger, so explicitly set it to # go to stderr. @@ -170,7 +172,7 @@ class ConfigLayer: zc.testing package. There should be a better way! """ from zope.testing.testrunner.options import parser - parser.add_option('-e', '--stderr', + parser.add_option(str('-e'), str('--stderr'), action='callback', callback=cls.handle_stderr, help=_('Propagate log errors to stderr.')) |
