Commit ab1fb9f7 authored by Benjamin Peterson's avatar Benjamin Peterson

Make error messages more helpful

parent e1b93f28
...@@ -157,10 +157,13 @@ class TestStdlibRemovals(unittest.TestCase): ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment