Commits

Georg Brandl committed dc495b6

Make WARNING the default warning prefix.

  • Participants
  • Parent commits 0f8fe75

Comments (0)

Files changed (3)

File sphinx/application.py

             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:

File tests/test_application.py

 
         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()

File tests/test_build.py

 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 = {