Mercurial > cpython-lru_cache-weakref
diff Lib/importlib/test/test_api.py @ 55737:b65ebed06eb0
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.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Thu, 27 Aug 2009 23:49:21 +0000 |
| parents | ebe10810ebed |
| children | 6c3c543ede8c |
line wrap: on
line diff
--- a/Lib/importlib/test/test_api.py Thu Aug 27 23:46:38 2009 +0000 +++ b/Lib/importlib/test/test_api.py Thu Aug 27 23:49:21 2009 +0000 @@ -63,7 +63,8 @@ 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():
