mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4081: Warnings and errors colored the same when building
This commit is contained in:
parent
b5edde474d
commit
273f834157
2
CHANGES
2
CHANGES
@ -58,7 +58,6 @@ Features added
|
|||||||
* #4332: Let LaTeX obey :confval:`math_numfig` for equation numbering
|
* #4332: Let LaTeX obey :confval:`math_numfig` for equation numbering
|
||||||
* #4093: sphinx-build creates empty directories for unknown targets/builders
|
* #4093: sphinx-build creates empty directories for unknown targets/builders
|
||||||
|
|
||||||
|
|
||||||
Features removed
|
Features removed
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@ -105,6 +104,7 @@ Bugs fixed
|
|||||||
setting
|
setting
|
||||||
* #4198: autosummary emits multiple 'autodoc-process-docstring' event. Thanks
|
* #4198: autosummary emits multiple 'autodoc-process-docstring' event. Thanks
|
||||||
to Joel Nothman.
|
to Joel Nothman.
|
||||||
|
* #4081: Warnings and errors colored the same when building
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -53,7 +53,7 @@ VERBOSITY_MAP.update({
|
|||||||
COLOR_MAP = defaultdict(lambda: 'blue') # type: Dict[int, unicode]
|
COLOR_MAP = defaultdict(lambda: 'blue') # type: Dict[int, unicode]
|
||||||
COLOR_MAP.update({
|
COLOR_MAP.update({
|
||||||
logging.ERROR: 'darkred',
|
logging.ERROR: 'darkred',
|
||||||
logging.WARNING: 'darkred',
|
logging.WARNING: 'red',
|
||||||
logging.DEBUG: 'darkgray',
|
logging.DEBUG: 'darkgray',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ def test_warning_location(app, status, warning):
|
|||||||
assert 'index.txt:10: WARNING: message2' in warning.getvalue()
|
assert 'index.txt:10: WARNING: message2' in warning.getvalue()
|
||||||
|
|
||||||
logger.warning('message3', location=None)
|
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 = nodes.Node()
|
||||||
node.source, node.line = ('index.txt', 10)
|
node.source, node.line = ('index.txt', 10)
|
||||||
@ -200,7 +200,7 @@ def test_warning_location(app, status, warning):
|
|||||||
|
|
||||||
node.source, node.line = (None, None)
|
node.source, node.line = (None, None)
|
||||||
logger.warning('message7', location=node)
|
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):
|
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 colorize('darkgray', 'message1') in status.getvalue()
|
||||||
assert 'message2\n' in status.getvalue() # not colored
|
assert 'message2\n' in status.getvalue() # not colored
|
||||||
assert 'message3\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 'WARNING: message5\n' in warning.getvalue() # not colored
|
||||||
assert colorize('darkred', 'WARNING: message6') in warning.getvalue()
|
assert colorize('darkred', 'WARNING: message6') in warning.getvalue()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user