summaryrefslogtreecommitdiff
path: root/src/mailman/styles/tests/test_styles.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/styles/tests/test_styles.py')
-rw-r--r--src/mailman/styles/tests/test_styles.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/mailman/styles/tests/test_styles.py b/src/mailman/styles/tests/test_styles.py
index 990ce541f..a2ffc931f 100644
--- a/src/mailman/styles/tests/test_styles.py
+++ b/src/mailman/styles/tests/test_styles.py
@@ -63,28 +63,16 @@ class TestStyle(unittest.TestCase):
# Registering a style with the same name as a previous style raises an
# exception.
self.manager.register(DummyStyle())
- try:
- self.manager.register(DummyStyle())
- except DuplicateStyleError:
- pass
- else:
- raise AssertionError('DuplicateStyleError exception expected')
+ self.assertRaises(DuplicateStyleError,
+ self.manager.register, DummyStyle())
def test_register_a_non_style(self):
# You can't register something that doesn't implement the IStyle
# interface.
- try:
- self.manager.register(object())
- except DoesNotImplement:
- pass
- else:
- raise AssertionError('DoesNotImplement exception expected')
+ self.assertRaises(DoesNotImplement,
+ self.manager.register, object())
def test_unregister_a_non_registered_style(self):
# You cannot unregister a style that hasn't yet been registered.
- try:
- self.manager.unregister(DummyStyle())
- except KeyError:
- pass
- else:
- raise AssertionError('KeyError expected')
+ self.assertRaises(KeyError,
+ self.manager.unregister, DummyStyle())