From: Benjamin Peterson Date: Mon, 12 May 2008 22:26:05 +0000 (+0000) Subject: Make error messages more helpful X-Git-Tag: v2.6b1~446 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab1fb9f72821f4b1ebb8fccb0682e754e6b4f323;p=python Make error messages more helpful --- diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 39086e9cd9..8fd5586e17 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -157,10 +157,13 @@ class TestStdlibRemovals(unittest.TestCase): try: __import__(module_name, level=0) 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: if not optional: - raise + self.fail("Non-optional module %s raised an " + "ImportError." % module_name) else: self.fail("DeprecationWarning not raised for %s" % module_name)