diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_mailbox.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index e09aea4..8f76e18 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -111,10 +111,10 @@ class TestMailbox(TestBase): self.assertMailboxEmpty() def test_add_that_raises_leaves_mailbox_empty(self): - # XXX This test will start failing when Message learns to handle - # non-ASCII string headers, and a different internal failure will - # need to be found or manufactured. - with self.assertRaises(ValueError): + def raiser(*args, **kw): + raise Exception("a fake error") + support.patch(self, email.generator.BytesGenerator, 'flatten', raiser) + with self.assertRaises(Exception): self._box.add(email.message_from_string("From: Alphöso")) self.assertEqual(len(self._box), 0) self._box.close() |