mirror of
https://github.com/python/cpython.git
synced 2025-12-08 18:32:16 +00:00
Make error messages more helpful
This commit is contained in:
parent
e1b93f2855
commit
ab1fb9f728
1 changed files with 5 additions and 2 deletions
|
|
@ -157,10 +157,13 @@ class TestStdlibRemovals(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
__import__(module_name, level=0)
|
__import__(module_name, level=0)
|
||||||
except DeprecationWarning as exc:
|
except DeprecationWarning as exc:
|
||||||
self.assert_(module_name in exc.args[0])
|
self.assert_(module_name in exc.args[0],
|
||||||
|
"%s warning didn't contain module name"
|
||||||
|
% module_name)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if not optional:
|
if not optional:
|
||||||
raise
|
self.fail("Non-optional module %s raised an "
|
||||||
|
"ImportError." % module_name)
|
||||||
else:
|
else:
|
||||||
self.fail("DeprecationWarning not raised for %s" %
|
self.fail("DeprecationWarning not raised for %s" %
|
||||||
module_name)
|
module_name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue