mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +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
|
|
@ -63,7 +63,8 @@ def test_absolute_import_with_package(self):
|
|||
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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue