mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix TOC is not shown when no `:maxdepth:` for toctrees (ref: #771)
This commit is contained in:
@@ -474,3 +474,25 @@ def test_toctree_maxdepth_howto(app, status, warning):
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert '\\setcounter{tocdepth}{2}' in result
|
||||
|
||||
|
||||
@with_app(buildername='latex', testroot='toctree-maxdepth',
|
||||
confoverrides={'master_doc': 'foo'})
|
||||
def test_toctree_not_found(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||
print(result)
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert '\\setcounter{tocdepth}' not in result
|
||||
|
||||
|
||||
@with_app(buildername='latex', testroot='toctree-maxdepth',
|
||||
confoverrides={'master_doc': 'bar'})
|
||||
def test_toctree_without_maxdepth(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||
print(result)
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert '\\setcounter{tocdepth}' not in result
|
||||
|
||||
Reference in New Issue
Block a user