mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
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:
parent
c5951fc996
commit
2153dc001f
9 changed files with 36 additions and 24 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue