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.
This commit is contained in:
Brett Cannon 2009-08-27 23:49:21 +00:00
parent c5951fc996
commit 2153dc001f
9 changed files with 36 additions and 24 deletions

View file

@ -81,7 +81,8 @@ class EncodingTest(unittest.TestCase):
# [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):