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 c7258dd08..29ab7169a 100644
--- a/src/mailman/testing/layers.py
+++ b/src/mailman/testing/layers.py
@@ -25,6 +25,7 @@ __all__ = [
'MockAndMonkeyLayer',
'RESTLayer',
'SMTPLayer',
+ 'is_testing',
]
@@ -108,6 +109,8 @@ class ConfigLayer(MockAndMonkeyLayer):
password_scheme: cleartext
[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')
@@ -290,3 +293,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