summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_py3kwarn.py7
1 files changed, 5 insertions, 2 deletions
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)