From 6c2a32a95edf38dddbcc55a09b14bdb988e16b2c Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Fri, 12 Mar 2021 12:15:19 -0500 Subject: [PATCH] Tests: Run against nav toctree and not builtin toctree Before, the test were checking the `.. toctree::` directive and not the navigation toctree in our template. This is now fixed. A white space change was made so we dont have to include the white space in the search string. The test project was update to not collapse the navigation and to use infinite toc depth to match the old test case. --- sphinx_rtd_theme/layout.html | 2 +- tests/roots/test-basic/conf.py | 5 +++++ tests/test_builders.py | 13 ++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index bbfdbff6a..faf3a8aef 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -160,7 +160,7 @@ includehidden=theme_includehidden|tobool, titles_only=theme_titles_only|tobool) %} {%- if toctree %} - {{ toctree }} + {{- toctree }} {%- else %}
{{ toc }}
diff --git a/tests/roots/test-basic/conf.py b/tests/roots/test-basic/conf.py index e10f5e5fb..6ec95f40b 100644 --- a/tests/roots/test-basic/conf.py +++ b/tests/roots/test-basic/conf.py @@ -2,3 +2,8 @@ master_doc = 'index' exclude_patterns = ['_build'] + +html_theme_options = { + 'collapse_navigation': False, + 'navigation_depth': -1, +} diff --git a/tests/test_builders.py b/tests/test_builders.py index ce8fb3cc1..6c8266966 100644 --- a/tests/test_builders.py +++ b/tests/test_builders.py @@ -15,7 +15,7 @@ def test_basic(): if isinstance(app.builder, DirectoryHTMLBuilder): search = ( - '
\n' + '' ) assert search in content elif isinstance(app.builder, SingleFileHTMLBuilder): search = ( + '