summaryrefslogtreecommitdiff
path: root/tests/test_ext_apidoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ext_apidoc.py')
-rw-r--r--tests/test_ext_apidoc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py
index 9fefb4ce9..c6cf43c7e 100644
--- a/tests/test_ext_apidoc.py
+++ b/tests/test_ext_apidoc.py
@@ -401,6 +401,21 @@ def test_subpackage_in_toc(make_app, apidoc):
assert (outdir / 'parent.child.foo.rst').isfile()
+def test_private(tempdir):
+ (tempdir / 'hello.py').write_text('')
+ (tempdir / '_world.py').write_text('')
+
+ # without --private option
+ apidoc_main(['-o', tempdir, tempdir])
+ assert (tempdir / 'hello.rst').exists()
+ assert not (tempdir / '_world.rst').exists()
+
+ # with --private option
+ apidoc_main(['--private', '-o', tempdir, tempdir])
+ assert (tempdir / 'hello.rst').exists()
+ assert (tempdir / '_world.rst').exists()
+
+
def test_toc_file(tempdir):
outdir = path(tempdir)
(outdir / 'module').makedirs()