diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-08-27 23:49:21 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-08-27 23:49:21 (GMT) |
commit | 2153dc001f5565592b44808d7f0f25815010eb9d (patch) | |
tree | 8801111b4467bd21f5f936d3fd6196d41f77688f /Lib/importlib/test/extension/test_loader.py | |
parent | c5951fc996ad74a05e83a61cf0345a4a68c01b12 (diff) | |
download | cpython-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/extension/test_loader.py')
-rw-r--r-- | Lib/importlib/test/extension/test_loader.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/test/extension/test_loader.py b/Lib/importlib/test/extension/test_loader.py index 71841c6..7f6eda3 100644 --- a/Lib/importlib/test/extension/test_loader.py +++ b/Lib/importlib/test/extension/test_loader.py @@ -46,7 +46,8 @@ class LoaderTests(abc.LoaderTests): pass def test_unloadable(self): - self.assertRaises(ImportError, self.load_module, 'asdfjkl;') + with self.assertRaises(ImportError): + self.load_module('asdfjkl;') def test_main(): |