[Python-checkins] r71674 - in python/trunk/Lib/distutils: command/check.py tests/test_check.py
tarek.ziade
python-checkins at python.org
Fri Apr 17 16:29:56 CEST 2009
Author: tarek.ziade
Date: Fri Apr 17 16:29:56 2009
New Revision: 71674
Log:
DistutilsSetupError was not raised when one single warning occured
Modified:
python/trunk/Lib/distutils/command/check.py
python/trunk/Lib/distutils/tests/test_check.py
Modified: python/trunk/Lib/distutils/command/check.py
==============================================================================
--- python/trunk/Lib/distutils/command/check.py (original)
+++ python/trunk/Lib/distutils/command/check.py Fri Apr 17 16:29:56 2009
@@ -72,7 +72,7 @@
# let's raise an error in strict mode, if we have at least
# one warning
- if self.strict and self._warnings > 1:
+ if self.strict and self._warnings > 0:
raise DistutilsSetupError('Please correct your package.')
def check_metadata(self):
Modified: python/trunk/Lib/distutils/tests/test_check.py
==============================================================================
--- python/trunk/Lib/distutils/tests/test_check.py (original)
+++ python/trunk/Lib/distutils/tests/test_check.py Fri Apr 17 16:29:56 2009
@@ -72,17 +72,16 @@
self.assertEquals(cmd._warnings, 1)
# let's see if we have an error with strict=1
- cmd = check(dist)
- cmd.initialize_options()
- cmd.strict = 1
- cmd.ensure_finalized()
- self.assertRaises(DistutilsSetupError, cmd.run)
+ metadata = {'url': 'xxx', 'author': 'xxx',
+ 'author_email': 'xxx',
+ 'name': 'xxx', 'version': 'xxx',
+ 'long_description': broken_rest}
+ self.assertRaises(DistutilsSetupError, self._run, metadata,
+ **{'strict': 1, 'restructuredtext': 1})
# and non-broken rest
- rest = 'title\n=====\n\ntest'
- pkg_info, dist = self.create_dist(long_description=rest)
- cmd = check(dist)
- cmd.check_restructuredtext()
+ metadata['long_description'] = 'title\n=====\n\ntest'
+ cmd = self._run(metadata, strict=1, restructuredtext=1)
self.assertEquals(cmd._warnings, 0)
def test_check_all(self):
More information about the Python-checkins
mailing list