Merge pull request #7940 from AleksaC/fix_double_trailing_newline_apidoc

Fix double trailing newline apidoc
This commit is contained in:
Takeshi KOMIYA
2020-07-12 22:15:55 +09:00
committed by GitHub
2 changed files with 4 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ Submodules
----------
{% if separatemodules %}
{{ toctree(submodules) }}
{%- else %}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
@@ -43,7 +43,7 @@ Submodules
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{% endif %}
{%- endif %}
{%- if not modulefirst and not is_namespace %}
Module contents

View File

@@ -121,7 +121,6 @@ def test_pep_0420_enabled_separate(make_app, apidoc):
with open(outdir / 'a.b.c.rst') as f:
rst = f.read()
assert ".. toctree::\n :maxdepth: 4\n\n a.b.c.d\n" in rst
with open(outdir / 'a.b.e.rst') as f:
@@ -509,7 +508,6 @@ def test_package_file(tempdir):
" :undoc-members:\n"
" :show-inheritance:\n"
"\n"
"\n"
"Module contents\n"
"---------------\n"
"\n"
@@ -595,8 +593,7 @@ def test_package_file_module_first(tempdir):
".. automodule:: testpkg.example\n"
" :members:\n"
" :undoc-members:\n"
" :show-inheritance:\n"
"\n")
" :show-inheritance:\n")
def test_package_file_without_submodules(tempdir):
@@ -639,5 +636,4 @@ def test_namespace_package_file(tempdir):
".. automodule:: testpkg.example\n"
" :members:\n"
" :undoc-members:\n"
" :show-inheritance:\n"
"\n")
" :show-inheritance:\n")