summaryrefslogtreecommitdiff
path: root/src/mailman/testing/layers.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/testing/layers.py')
-rw-r--r--src/mailman/testing/layers.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py
index 2e765ea3e..ca417fc2c 100644
--- a/src/mailman/testing/layers.py
+++ b/src/mailman/testing/layers.py
@@ -25,6 +25,7 @@ __all__ = [
'MockAndMonkeyLayer',
'RESTLayer',
'SMTPLayer',
+ 'is_testing',
]
@@ -106,6 +107,8 @@ class ConfigLayer(MockAndMonkeyLayer):
layout: testing
[paths.testing]
var_dir: %s
+ [devmode]
+ testing: yes
""" % cls.var_dir)
# Read the testing config and push it.
test_config += resource_string('mailman.testing', 'testing.cfg')
@@ -288,3 +291,13 @@ class RESTLayer(SMTPLayer):
assert cls.server is not None, 'Layer not set up'
cls.server.stop()
cls.server = None
+
+
+
+def is_testing():
+ """Return a 'testing' flag for use with the predictable factories.
+
+ :return: True when in testing mode.
+ :rtype: bool
+ """
+ return MockAndMonkeyLayer.testing_mode or config.devmode.testing