summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test/test_api.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/test_api.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/test_api.py')
-rw-r--r--Lib/importlib/test/test_api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/test/test_api.py b/Lib/importlib/test/test_api.py
index 65f8d04..e729013 100644
--- a/Lib/importlib/test/test_api.py
+++ b/Lib/importlib/test/test_api.py
@@ -63,7 +63,8 @@ class ImportModuleTests(unittest.TestCase):
def test_relative_import_wo_package(self):
# Relative imports cannot happen without the 'package' argument being
# set.
- self.assertRaises(TypeError, importlib.import_module, '.support')
+ with self.assertRaises(TypeError):
+ importlib.import_module('.support')
def test_main():