diff options
| author | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
| commit | a9464c14fc6dfc23613a1ec89446393fe6476f88 (patch) | |
| tree | 74a926cfe64066ebffcf9adb89e7672289173d84 /src/mailman/utilities/tests/test_templates.py | |
| parent | a1666479d87e26e5c79dd1cf507b8ef0472c59aa (diff) | |
| download | mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.gz mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.zst mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.zip | |
Diffstat (limited to 'src/mailman/utilities/tests/test_templates.py')
| -rw-r--r-- | src/mailman/utilities/tests/test_templates.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mailman/utilities/tests/test_templates.py b/src/mailman/utilities/tests/test_templates.py index d205eef34..8e335f69b 100644 --- a/src/mailman/utilities/tests/test_templates.py +++ b/src/mailman/utilities/tests/test_templates.py @@ -224,13 +224,9 @@ class TestFind(unittest.TestCase): self.assertEqual(self.fp.read(), 'List template') def test_template_not_found(self): - # Python 2.6 compatibility. - try: + with self.assertRaises(TemplateNotFoundError) as cm: find('missing.txt', self.mlist) - except TemplateNotFoundError as error: - self.assertEqual(error.template_file, 'missing.txt') - else: - raise AssertionError('TemplateNotFoundError expected') + self.assertEqual(cm.exception.template_file, 'missing.txt') |
