From 0473e438dcf766ba746b6fb08f2e1e49c1b66bc5 Mon Sep 17 00:00:00 2001 From: jfbu Date: Fri, 4 Nov 2016 23:57:00 +0100 Subject: [PATCH 1/2] add unit test for maxlistdepth (latex) --- tests/roots/test-maxlistdepth/conf.py | 14 ++++++ tests/roots/test-maxlistdepth/index.rst | 57 +++++++++++++++++++++++++ tests/test_build_latex.py | 9 ++++ 3 files changed, 80 insertions(+) create mode 100644 tests/roots/test-maxlistdepth/conf.py create mode 100644 tests/roots/test-maxlistdepth/index.rst diff --git a/tests/roots/test-maxlistdepth/conf.py b/tests/roots/test-maxlistdepth/conf.py new file mode 100644 index 000000000..5a43b67bf --- /dev/null +++ b/tests/roots/test-maxlistdepth/conf.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +master_doc = 'index' +html_theme = 'classic' +exclude_patterns = ['_build'] + +latex_documents = [ + ('index', 'SphinxTests.tex', 'Testing maxlistdepth=10', + 'Georg Brandl', 'howto'), + ] + +latex_elements = { + 'maxlistdepth': '10', +} diff --git a/tests/roots/test-maxlistdepth/index.rst b/tests/roots/test-maxlistdepth/index.rst new file mode 100644 index 000000000..5d9bc2193 --- /dev/null +++ b/tests/roots/test-maxlistdepth/index.rst @@ -0,0 +1,57 @@ +test-maxlistdepth +================= + + +1. 1 + + 1. 2 + + 1. 3 + + 1. 4 + + 1. 5 + + 1. 6 + + 1. 7 + + 1. 8 + + 1. 9 + + 10a + + - 10b + + .. code-block:: python + + def foo(): + + +- 1 + + - 2 + + - 3 + + - 4 + + - 5 + + - 6 + + - 7 + + - 8 + + 1. 9 + + 10a + + 1. 10b + + .. code-block:: python + + def foo(): + diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 756648254..098d76fcf 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -710,3 +710,12 @@ def test_latex_toplevel_sectioning_is_section(app, status, warning): print(status.getvalue()) print(warning.getvalue()) assert '\\section{Foo}' in result + +@with_app(buildername='latex', testroot='maxlistdepth') +def test_maxlistdepth_at_ten(app, status, warning): + app.builder.build_all() + result = (app.outdir / 'SphinxTests.tex').text(encoding='utf8') + print(result) + print(status.getvalue()) + print(warning.getvalue()) + compile_latex_document(app) From 53d202440fbcd0838251b59047e27e24dfc7d337 Mon Sep 17 00:00:00 2001 From: jfbu Date: Sat, 5 Nov 2016 11:50:12 +0100 Subject: [PATCH 2/2] add ``@skip_if_stylefiles_notfound`` to maxlistdepth test --- tests/test_build_latex.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 098d76fcf..fcef77be6 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -711,6 +711,7 @@ def test_latex_toplevel_sectioning_is_section(app, status, warning): print(warning.getvalue()) assert '\\section{Foo}' in result +@skip_if_stylefiles_notfound @with_app(buildername='latex', testroot='maxlistdepth') def test_maxlistdepth_at_ten(app, status, warning): app.builder.build_all()