summaryrefslogtreecommitdiff
path: root/mailman/testing/layers.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-01-01 17:07:06 -0500
committerBarry Warsaw2009-01-01 17:07:06 -0500
commit2413e18a366024b9d64bf6eb7d8afee50f7441da (patch)
treee703dd9c4db3a3bfd1773c6d8d1fa7c403f720d8 /mailman/testing/layers.py
parent6e22adb521769a666d3db85384d619528d7982a0 (diff)
downloadmailman-2413e18a366024b9d64bf6eb7d8afee50f7441da.tar.gz
mailman-2413e18a366024b9d64bf6eb7d8afee50f7441da.tar.zst
mailman-2413e18a366024b9d64bf6eb7d8afee50f7441da.zip
Diffstat (limited to 'mailman/testing/layers.py')
-rw-r--r--mailman/testing/layers.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/mailman/testing/layers.py b/mailman/testing/layers.py
index 5976d9e4e..656bac5bd 100644
--- a/mailman/testing/layers.py
+++ b/mailman/testing/layers.py
@@ -36,8 +36,9 @@ from textwrap import dedent
from mailman.config import config
from mailman.core import initialize
-from mailman.i18n import _
from mailman.core.logging import get_handler
+from mailman.core.styles import style_manager
+from mailman.i18n import _
from mailman.testing.helpers import SMTPServer
@@ -135,11 +136,13 @@ class ConfigLayer:
cls.var_dir = None
@classmethod
- def testSetUp(self):
- pass
+ def testSetUp(cls):
+ # Record the current (default) set of styles so that we can reset them
+ # easily in the tear down.
+ cls.styles = set(style_manager.styles)
@classmethod
- def testTearDown(self):
+ def testTearDown(cls):
# Reset the database between tests.
config.db._reset()
# Remove all residual queue files.
@@ -150,6 +153,11 @@ class ConfigLayer:
for message in config.db.message_store.messages:
config.db.message_store.delete_message(message['message-id'])
config.db.commit()
+ # Reset the global style manager.
+ new_styles = set(style_manager.styles) - cls.styles
+ for style in new_styles:
+ style_manager.unregister(style)
+ cls.styles = None
# Flag to indicate that loggers should propagate to the console.
stderr = False