summaryrefslogtreecommitdiff
path: root/tests/test_ext_apidoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-23 00:35:23 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-23 00:40:16 +0900
commit650f8ea237a6e3d0603bddde21a1db5523c343fe (patch)
treec0a9997bd1f04cb271166095b02dec234616328e /tests/test_ext_apidoc.py
parenta71028bf9e18cf9fb6314c8a13a467d724cd9328 (diff)
downloadsphinx-git-650f8ea237a6e3d0603bddde21a1db5523c343fe.tar.gz
Fix #8727: apidoc: namespace module file is not generated if no submodules
sphinx-apidoc should generate a namespace module file when `--implicit-namespace` option given. This fixes the case the namespace module has subpackages, but no submodules.
Diffstat (limited to 'tests/test_ext_apidoc.py')
-rw-r--r--tests/test_ext_apidoc.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py
index 980c6dcac..d6c45c268 100644
--- a/tests/test_ext_apidoc.py
+++ b/tests/test_ext_apidoc.py
@@ -216,6 +216,8 @@ def test_trailing_underscore(make_app, apidoc):
def test_excludes(apidoc):
outdir = apidoc.outdir
assert (outdir / 'conf.py').isfile()
+ assert (outdir / 'a.rst').isfile()
+ assert (outdir / 'a.b.rst').isfile()
assert (outdir / 'a.b.c.rst').isfile() # generated because not empty
assert not (outdir / 'a.b.e.rst').isfile() # skipped because of empty after excludes
assert (outdir / 'a.b.x.rst').isfile()
@@ -231,6 +233,8 @@ def test_excludes_subpackage_should_be_skipped(apidoc):
"""Subpackage exclusion should work."""
outdir = apidoc.outdir
assert (outdir / 'conf.py').isfile()
+ assert (outdir / 'a.rst').isfile()
+ assert (outdir / 'a.b.rst').isfile()
assert (outdir / 'a.b.c.rst').isfile() # generated because not empty
assert not (outdir / 'a.b.e.f.rst').isfile() # skipped because 'b/e' subpackage is skipped
@@ -244,6 +248,8 @@ def test_excludes_module_should_be_skipped(apidoc):
"""Module exclusion should work."""
outdir = apidoc.outdir
assert (outdir / 'conf.py').isfile()
+ assert (outdir / 'a.rst').isfile()
+ assert (outdir / 'a.b.rst').isfile()
assert (outdir / 'a.b.c.rst').isfile() # generated because not empty
assert not (outdir / 'a.b.e.f.rst').isfile() # skipped because of empty after excludes
@@ -257,6 +263,8 @@ def test_excludes_module_should_not_be_skipped(apidoc):
"""Module should be included if no excludes are used."""
outdir = apidoc.outdir
assert (outdir / 'conf.py').isfile()
+ assert (outdir / 'a.rst').isfile()
+ assert (outdir / 'a.b.rst').isfile()
assert (outdir / 'a.b.c.rst').isfile() # generated because not empty
assert (outdir / 'a.b.e.f.rst').isfile() # skipped because of empty after excludes