Commit a97cd0de authored by Tarek Ziadé's avatar Tarek Ziadé

Merged revisions 71674 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71674 | tarek.ziade | 2009-04-17 16:29:56 +0200 (Fri, 17 Apr 2009) | 1 line

  DistutilsSetupError was not raised when one single warning occured
........
parent 5ff3e081
...@@ -73,7 +73,7 @@ class check(Command): ...@@ -73,7 +73,7 @@ class check(Command):
# let's raise an error in strict mode, if we have at least # let's raise an error in strict mode, if we have at least
# one warning # one warning
if self.strict and self._warnings > 1: if self.strict and self._warnings > 0:
raise DistutilsSetupError('Please correct your package.') raise DistutilsSetupError('Please correct your package.')
def check_metadata(self): def check_metadata(self):
......
...@@ -72,17 +72,16 @@ class CheckTestCase(support.LoggingSilencer, ...@@ -72,17 +72,16 @@ class CheckTestCase(support.LoggingSilencer,
self.assertEquals(cmd._warnings, 1) self.assertEquals(cmd._warnings, 1)
# let's see if we have an error with strict=1 # let's see if we have an error with strict=1
cmd = check(dist) metadata = {'url': 'xxx', 'author': 'xxx',
cmd.initialize_options() 'author_email': 'xxx',
cmd.strict = 1 'name': 'xxx', 'version': 'xxx',
cmd.ensure_finalized() 'long_description': broken_rest}
self.assertRaises(DistutilsSetupError, cmd.run) self.assertRaises(DistutilsSetupError, self._run, metadata,
**{'strict': 1, 'restructuredtext': 1})
# and non-broken rest # and non-broken rest
rest = 'title\n=====\n\ntest' metadata['long_description'] = 'title\n=====\n\ntest'
pkg_info, dist = self.create_dist(long_description=rest) cmd = self._run(metadata, strict=1, restructuredtext=1)
cmd = check(dist)
cmd.check_restructuredtext()
self.assertEquals(cmd._warnings, 0) self.assertEquals(cmd._warnings, 0)
def test_check_all(self): def test_check_all(self):
......
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