From eb0558e144b2acaec0b9cd698b8cb1156150df0d Mon Sep 17 00:00:00 2001 From: Matthew Tretter Date: Thu, 6 Sep 2012 23:08:50 -0400 Subject: [PATCH] Change assertRaises for Python 2.6 compatibility --- tests/core/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/core/tests.py b/tests/core/tests.py index b4884c8..a73915e 100644 --- a/tests/core/tests.py +++ b/tests/core/tests.py @@ -52,15 +52,15 @@ class IKUtilsTest(TestCase): self.assertEqual(utils.extension_to_format('.jpeg'), 'JPEG') self.assertEqual(utils.extension_to_format('.rgba'), 'SGI') - with self.assertRaises(utils.UnknownExtensionError): - utils.extension_to_format('.txt') + self.assertRaises(utils.UnknownExtensionError, + lambda: utils.extension_to_format('.txt')) def test_format_to_extension_no_init(self): self.assertEqual(utils.format_to_extension('PNG'), '.png') self.assertEqual(utils.format_to_extension('ICO'), '.ico') - with self.assertRaises(utils.UnknownFormatError): - utils.format_to_extension('TXT') + self.assertRaises(utils.UnknownFormatError, + lambda: utils.format_to_extension('TXT')) class PickleTest(TestCase):