mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8474 from tk0miya/8360_update_warning_for_numref
Fix #8360: Update warning message for numref
This commit is contained in:
commit
3e9200dab4
@ -852,8 +852,9 @@ class StandardDomain(Domain):
|
||||
if fignumber is None:
|
||||
return contnode
|
||||
except ValueError:
|
||||
logger.warning(__("no number is assigned for %s: %s"), figtype, labelid,
|
||||
location=node)
|
||||
logger.warning(__("Failed to create a cross reference. Any number is not "
|
||||
"assigned: %s"),
|
||||
labelid, location=node)
|
||||
return contnode
|
||||
|
||||
try:
|
||||
|
@ -660,7 +660,7 @@ def test_numfig_without_numbered_toctree_warn(app, warning):
|
||||
|
||||
warnings = warning.getvalue()
|
||||
assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' not in warnings
|
||||
assert 'index.rst:55: WARNING: no number is assigned for section: index' in warnings
|
||||
assert 'index.rst:55: WARNING: Failed to create a cross reference. Any number is not assigned: index' in warnings
|
||||
assert 'index.rst:56: WARNING: invalid numfig_format: invalid' in warnings
|
||||
assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' in warnings
|
||||
|
||||
@ -768,7 +768,7 @@ def test_numfig_with_numbered_toctree_warn(app, warning):
|
||||
app.build()
|
||||
warnings = warning.getvalue()
|
||||
assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' not in warnings
|
||||
assert 'index.rst:55: WARNING: no number is assigned for section: index' in warnings
|
||||
assert 'index.rst:55: WARNING: Failed to create a cross reference. Any number is not assigned: index' in warnings
|
||||
assert 'index.rst:56: WARNING: invalid numfig_format: invalid' in warnings
|
||||
assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' in warnings
|
||||
|
||||
@ -873,7 +873,7 @@ def test_numfig_with_prefix_warn(app, warning):
|
||||
app.build()
|
||||
warnings = warning.getvalue()
|
||||
assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' not in warnings
|
||||
assert 'index.rst:55: WARNING: no number is assigned for section: index' in warnings
|
||||
assert 'index.rst:55: WARNING: Failed to create a cross reference. Any number is not assigned: index' in warnings
|
||||
assert 'index.rst:56: WARNING: invalid numfig_format: invalid' in warnings
|
||||
assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' in warnings
|
||||
|
||||
@ -979,7 +979,7 @@ def test_numfig_with_secnum_depth_warn(app, warning):
|
||||
app.build()
|
||||
warnings = warning.getvalue()
|
||||
assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' not in warnings
|
||||
assert 'index.rst:55: WARNING: no number is assigned for section: index' in warnings
|
||||
assert 'index.rst:55: WARNING: Failed to create a cross reference. Any number is not assigned: index' in warnings
|
||||
assert 'index.rst:56: WARNING: invalid numfig_format: invalid' in warnings
|
||||
assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' in warnings
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user