From 26e29de9045103f4a23be59ff7ab964c974ab3e1 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 6 Jan 2016 09:51:34 +0900 Subject: [PATCH] Fix broken testcase; Split test-toctree-maxdepth from test-tocdepth --- tests/roots/test-tocdepth/index.rst | 1 - tests/roots/test-toctree-maxdepth/bar.rst | 27 +++++++++++++++++++++ tests/roots/test-toctree-maxdepth/baz.rst | 5 ++++ tests/roots/test-toctree-maxdepth/conf.py | 4 +++ tests/roots/test-toctree-maxdepth/foo.rst | 26 ++++++++++++++++++++ tests/roots/test-toctree-maxdepth/index.rst | 9 +++++++ tests/test_build_latex.py | 4 +-- 7 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 tests/roots/test-toctree-maxdepth/bar.rst create mode 100644 tests/roots/test-toctree-maxdepth/baz.rst create mode 100644 tests/roots/test-toctree-maxdepth/conf.py create mode 100644 tests/roots/test-toctree-maxdepth/foo.rst create mode 100644 tests/roots/test-toctree-maxdepth/index.rst diff --git a/tests/roots/test-tocdepth/index.rst b/tests/roots/test-tocdepth/index.rst index a702cb88b..0b651d483 100644 --- a/tests/roots/test-tocdepth/index.rst +++ b/tests/roots/test-tocdepth/index.rst @@ -3,7 +3,6 @@ test-tocdepth .. toctree:: :numbered: - :maxdepth: 2 foo bar diff --git a/tests/roots/test-toctree-maxdepth/bar.rst b/tests/roots/test-toctree-maxdepth/bar.rst new file mode 100644 index 000000000..d70dec90d --- /dev/null +++ b/tests/roots/test-toctree-maxdepth/bar.rst @@ -0,0 +1,27 @@ +:tocdepth: 2 + +=== +Bar +=== + +should be 2 + +Bar A +===== + +should be 2.1 + +.. toctree:: + + baz + +Bar B +===== + +should be 2.2 + +Bar B1 +------ + +should be 2.2.1 + diff --git a/tests/roots/test-toctree-maxdepth/baz.rst b/tests/roots/test-toctree-maxdepth/baz.rst new file mode 100644 index 000000000..b07fa0507 --- /dev/null +++ b/tests/roots/test-toctree-maxdepth/baz.rst @@ -0,0 +1,5 @@ +Baz A +----- + +should be 2.1.1 + diff --git a/tests/roots/test-toctree-maxdepth/conf.py b/tests/roots/test-toctree-maxdepth/conf.py new file mode 100644 index 000000000..cf05c9b5c --- /dev/null +++ b/tests/roots/test-toctree-maxdepth/conf.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +master_doc = 'index' +html_theme = 'classic' diff --git a/tests/roots/test-toctree-maxdepth/foo.rst b/tests/roots/test-toctree-maxdepth/foo.rst new file mode 100644 index 000000000..61fd539ff --- /dev/null +++ b/tests/roots/test-toctree-maxdepth/foo.rst @@ -0,0 +1,26 @@ +=== +Foo +=== + +should be 1 + +Foo A +===== + +should be 1.1 + +Foo A1 +------ + +should be 1.1.1 + +Foo B +===== + +should be 1.2 + +Foo B1 +------ + +should be 1.2.1 + diff --git a/tests/roots/test-toctree-maxdepth/index.rst b/tests/roots/test-toctree-maxdepth/index.rst new file mode 100644 index 000000000..30dc61c8b --- /dev/null +++ b/tests/roots/test-toctree-maxdepth/index.rst @@ -0,0 +1,9 @@ +test-toctree-max-depth +====================== + +.. toctree:: + :numbered: + :maxdepth: 2 + + foo + bar diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 81f436c3a..9b58a6746 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -430,7 +430,7 @@ def test_latex_logo_if_not_found(app, status, warning): assert isinstance(exc, SphinxError) -@with_app(buildername='latex', testroot='tocdepth', +@with_app(buildername='latex', testroot='toctree-maxdepth', confoverrides={'latex_documents': [ ('index', 'SphinxTests.tex', 'Sphinx Tests Documentation', 'Georg Brandl', 'manual'), @@ -444,7 +444,7 @@ def test_toctree_maxdepth_manual(app, status, warning): assert '\\setcounter{tocdepth}{1}' in result -@with_app(buildername='latex', testroot='tocdepth', +@with_app(buildername='latex', testroot='toctree-maxdepth', confoverrides={'latex_documents': [ ('index', 'SphinxTests.tex', 'Sphinx Tests Documentation', 'Georg Brandl', 'howto'),