diff --git a/sphinx/application.py b/sphinx/application.py index 9e4502402..9c4670660 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -134,7 +134,7 @@ class Sphinx(object): self.emit('build-finished', None) self.builder.cleanup() - def warn(self, message, location=None, prefix='warning: '): + def warn(self, message, location=None, prefix='WARNING: '): warntext = location and '%s: %s%s\n' % (location, prefix, message) or \ '%s%s\n' % (prefix, message) if self.warningiserror: diff --git a/tests/test_application.py b/tests/test_application.py index 4fda0edbb..6425e2753 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -53,7 +53,7 @@ def test_output(): old_count = app._warncount app.warn("Bad news!") - assert warnings.getvalue() == "warning: Bad news!\n" + assert warnings.getvalue() == "WARNING: Bad news!\n" assert app._warncount == old_count + 1 finally: app.cleanup() diff --git a/tests/test_build.py b/tests/test_build.py index 00a82b4d5..f509a9f43 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -38,24 +38,24 @@ html_warnfile = StringIO() latex_warnfile = StringIO() ENV_WARNINGS = """\ -%(root)s/images.txt:9: warning: image file not readable: foo.png -%(root)s/images.txt:23: warning: nonlocal image URI found: \ +%(root)s/images.txt:9: WARNING: image file not readable: foo.png +%(root)s/images.txt:23: WARNING: nonlocal image URI found: \ http://www.python.org/logo.png %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading \ included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option -%(root)s/includes.txt:56: warning: download file not readable: nonexisting.png +%(root)s/includes.txt:56: WARNING: download file not readable: nonexisting.png """ HTML_WARNINGS = ENV_WARNINGS + """\ -%(root)s/images.txt:20: warning: no matching candidate for image URI u'foo.*' -%(root)s/markup.txt:: warning: invalid index entry u'' -%(root)s/markup.txt:: warning: invalid pair index entry u'' -%(root)s/markup.txt:: warning: invalid pair index entry u'keyword; ' +%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*' +%(root)s/markup.txt:: WARNING: invalid index entry u'' +%(root)s/markup.txt:: WARNING: invalid pair index entry u'' +%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; ' """ LATEX_WARNINGS = ENV_WARNINGS + """\ -None:None: warning: no matching candidate for image URI u'foo.*' -warning: invalid pair index entry u'' +None:None: WARNING: no matching candidate for image URI u'foo.*' +WARNING: invalid pair index entry u'' """ HTML_XPATH = {