diff Lib/importlib/test/source/test_source_encoding.py @ 55737:b65ebed06eb0

Move over to using assertRaises as a context manager for importlib tests. Obviously one shouldn't do whole sale conversions like this, but I was already going through the test code and I was bored at the airport.
author Brett Cannon <bcannon@gmail.com>
date Thu, 27 Aug 2009 23:49:21 +0000
parents 04a5b6438526
children 7b69e630d237
line wrap: on
line diff
--- a/Lib/importlib/test/source/test_source_encoding.py	Thu Aug 27 23:46:38 2009 +0000
+++ b/Lib/importlib/test/source/test_source_encoding.py	Thu Aug 27 23:49:21 2009 +0000
@@ -81,7 +81,8 @@
     # [BOM conflict]
     def test_bom_conflict(self):
         source = codecs.BOM_UTF8 + self.create_source('latin-1')
-        self.assertRaises(SyntaxError, self.run_test, source)
+        with self.assertRaises(SyntaxError):
+            self.run_test(source)
 
 
 class LineEndingTest(unittest.TestCase):