[Python-checkins] r63191 - python/trunk/Lib/test/test_py3kwarn.py
benjamin.peterson
python-checkins at python.org
Tue May 13 00:26:05 CEST 2008
Author: benjamin.peterson
Date: Tue May 13 00:26:05 2008
New Revision: 63191
Log:
Make error messages more helpful
Modified:
python/trunk/Lib/test/test_py3kwarn.py
Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py (original)
+++ python/trunk/Lib/test/test_py3kwarn.py Tue May 13 00:26:05 2008
@@ -157,10 +157,13 @@
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)
More information about the Python-checkins
mailing list