summaryrefslogtreecommitdiff
path: root/src/mailman/styles
diff options
context:
space:
mode:
authorBarry Warsaw2012-10-31 17:31:12 +0100
committerBarry Warsaw2012-10-31 17:31:12 +0100
commita9464c14fc6dfc23613a1ec89446393fe6476f88 (patch)
tree74a926cfe64066ebffcf9adb89e7672289173d84 /src/mailman/styles
parenta1666479d87e26e5c79dd1cf507b8ef0472c59aa (diff)
downloadmailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.gz
mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.zst
mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.zip
* Python 2.7 is not required. Python 2.6 is no longer officially supported.
The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
Diffstat (limited to 'src/mailman/styles')
-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())