Fix #4081: Warnings and errors colored the same when building

This commit is contained in:
Takeshi KOMIYA 2018-01-08 12:19:08 +09:00
parent b5edde474d
commit 273f834157
3 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,6 @@ Features added
* #4332: Let LaTeX obey :confval:`math_numfig` for equation numbering
* #4093: sphinx-build creates empty directories for unknown targets/builders
Features removed
----------------
@ -105,6 +104,7 @@ Bugs fixed
setting
* #4198: autosummary emits multiple 'autodoc-process-docstring' event. Thanks
to Joel Nothman.
* #4081: Warnings and errors colored the same when building
Testing
--------

View File

@ -53,7 +53,7 @@ VERBOSITY_MAP.update({
COLOR_MAP = defaultdict(lambda: 'blue') # type: Dict[int, unicode]
COLOR_MAP.update({
logging.ERROR: 'darkred',
logging.WARNING: 'darkred',
logging.WARNING: 'red',
logging.DEBUG: 'darkgray',
})

View File

@ -183,7 +183,7 @@ def test_warning_location(app, status, warning):
assert 'index.txt:10: WARNING: message2' in warning.getvalue()
logger.warning('message3', location=None)
assert colorize('darkred', 'WARNING: message3') in warning.getvalue()
assert colorize('red', 'WARNING: message3') in warning.getvalue()
node = nodes.Node()
node.source, node.line = ('index.txt', 10)
@ -200,7 +200,7 @@ def test_warning_location(app, status, warning):
node.source, node.line = (None, None)
logger.warning('message7', location=node)
assert colorize('darkred', 'WARNING: message7') in warning.getvalue()
assert colorize('red', 'WARNING: message7') in warning.getvalue()
def test_pending_warnings(app, status, warning):
@ -236,7 +236,7 @@ def test_colored_logs(app, status, warning):
assert colorize('darkgray', 'message1') in status.getvalue()
assert 'message2\n' in status.getvalue() # not colored
assert 'message3\n' in status.getvalue() # not colored
assert colorize('darkred', 'WARNING: message4') in warning.getvalue()
assert colorize('red', 'WARNING: message4') in warning.getvalue()
assert 'WARNING: message5\n' in warning.getvalue() # not colored
assert colorize('darkred', 'WARNING: message6') in warning.getvalue()