From beee9e80cdd288964628dfacc5907112e1b53a03 Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Wed, 29 Mar 2017 00:52:35 -0700 Subject: [PATCH] Add another test for empty toctree --- tests/roots/test-toctree-empty/_templates/localtoc.html | 2 ++ tests/roots/test-toctree-empty/conf.py | 1 + tests/test_toctree.py | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/roots/test-toctree-empty/_templates/localtoc.html diff --git a/tests/roots/test-toctree-empty/_templates/localtoc.html b/tests/roots/test-toctree-empty/_templates/localtoc.html new file mode 100644 index 000000000..0fd913922 --- /dev/null +++ b/tests/roots/test-toctree-empty/_templates/localtoc.html @@ -0,0 +1,2 @@ +{# This will call toctree unconditionally, whether there is a local or global toc #} +{{ toctree() }} diff --git a/tests/roots/test-toctree-empty/conf.py b/tests/roots/test-toctree-empty/conf.py index c46e40773..dac85eb9a 100644 --- a/tests/roots/test-toctree-empty/conf.py +++ b/tests/roots/test-toctree-empty/conf.py @@ -3,3 +3,4 @@ master_doc = 'index' html_theme = 'classic' exclude_patterns = ['_build'] +templates_path = ['_templates'] diff --git a/tests/test_toctree.py b/tests/test_toctree.py index a4c945667..e8b3dd9f2 100644 --- a/tests/test_toctree.py +++ b/tests/test_toctree.py @@ -30,7 +30,6 @@ def test_relations(app, status, warning): @pytest.mark.sphinx('singlehtml', testroot='toctree-empty') def test_singlehtml_toctree(app, status, warning): - docname = 'index' app.builder.build_all() try: app.builder._get_local_toctree('index')