summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test/source/test_source_encoding.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-08-27 23:49:21 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-08-27 23:49:21 (GMT)
commit2153dc001f5565592b44808d7f0f25815010eb9d (patch)
tree8801111b4467bd21f5f936d3fd6196d41f77688f /Lib/importlib/test/source/test_source_encoding.py
parentc5951fc996ad74a05e83a61cf0345a4a68c01b12 (diff)
downloadcpython-2153dc001f5565592b44808d7f0f25815010eb9d.zip
cpython-2153dc001f5565592b44808d7f0f25815010eb9d.tar.gz
cpython-2153dc001f5565592b44808d7f0f25815010eb9d.tar.bz2
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.
Diffstat (limited to 'Lib/importlib/test/source/test_source_encoding.py')
-rw-r--r--Lib/importlib/test/source/test_source_encoding.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/test/source/test_source_encoding.py b/Lib/importlib/test/source/test_source_encoding.py
index 3734712..fde355f 100644
--- a/Lib/importlib/test/source/test_source_encoding.py
+++ b/Lib/importlib/test/source/test_source_encoding.py
@@ -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):