Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
filterwarnings =
# Ignore external dependencies warning deprecations
# Sphinx
ignore::sphinx.deprecation.RemovedInSphinx90Warning
6 changes: 3 additions & 3 deletions tests/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def test_basic():
for (app, status, warning) in build_all('test-basic'):
assert app.env.get_doctree('index').traverse(addnodes.toctree)
assert app.env.get_doctree('index').findall(addnodes.toctree)
content = open(os.path.join(app.outdir, 'index.html')).read()

if isinstance(app.builder, DirectoryHTMLBuilder):
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_basic():
def test_empty():
"""Local TOC is showing, as toctree was empty"""
for (app, status, warning) in build_all('test-empty'):
assert app.env.get_doctree('index').traverse(addnodes.toctree)
assert app.env.get_doctree('index').findall(addnodes.toctree)
content = open(os.path.join(app.outdir, 'index.html')).read()
global_toc = '<div class="toctree-wrapper compound">\n</div>'
local_toc = (
Expand All @@ -81,7 +81,7 @@ def test_empty():
def test_missing_toctree():
"""Local TOC is showing, as toctree was missing"""
for (app, status, warning) in build_all('test-missing-toctree'):
assert app.env.get_doctree('index').traverse(addnodes.toctree) == []
assert list(app.env.get_doctree('index').findall(addnodes.toctree)) == []
content = open(os.path.join(app.outdir, 'index.html')).read()
assert '<div class="toctree' not in content
assert '<div class="local-toc">' in content