summaryrefslogtreecommitdiffstats
path: root/tests/test_extensions/test_ext_apidoc.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_extensions/test_ext_apidoc.py (renamed from tests/test_ext_apidoc.py)20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/test_ext_apidoc.py b/tests/test_extensions/test_ext_apidoc.py
index 1e089a3..c3c979f 100644
--- a/tests/test_ext_apidoc.py
+++ b/tests/test_extensions/test_ext_apidoc.py
@@ -15,7 +15,7 @@ def apidoc(rootdir, tmp_path, apidoc_params):
coderoot = rootdir / kwargs.get('coderoot', 'test-root')
outdir = tmp_path / 'out'
excludes = [str(coderoot / e) for e in kwargs.get('excludes', [])]
- args = ['-o', str(outdir), '-F', str(coderoot)] + excludes + kwargs.get('options', [])
+ args = ['-o', str(outdir), '-F', str(coderoot), *excludes, *kwargs.get('options', [])]
apidoc_main(args)
return namedtuple('apidoc', 'coderoot,outdir')(coderoot, outdir)
@@ -26,8 +26,7 @@ def apidoc_params(request):
kwargs = {}
for info in reversed(list(request.node.iter_markers("apidoc"))):
- for i, a in enumerate(info.args):
- pargs[i] = a
+ pargs |= dict(enumerate(info.args))
kwargs.update(info.kwargs)
args = [pargs[i] for i in sorted(pargs.keys())]
@@ -302,9 +301,9 @@ def test_extension_parsed(make_app, apidoc):
)
def test_toc_all_references_should_exist_pep420_enabled(make_app, apidoc):
"""All references in toc should exist. This test doesn't say if
- directories with empty __init__.py and and nothing else should be
- skipped, just ensures consistency between what's referenced in the toc
- and what is created. This is the variant with pep420 enabled.
+ directories with empty __init__.py and and nothing else should be
+ skipped, just ensures consistency between what's referenced in the toc
+ and what is created. This is the variant with pep420 enabled.
"""
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
@@ -332,9 +331,9 @@ def test_toc_all_references_should_exist_pep420_enabled(make_app, apidoc):
)
def test_toc_all_references_should_exist_pep420_disabled(make_app, apidoc):
"""All references in toc should exist. This test doesn't say if
- directories with empty __init__.py and and nothing else should be
- skipped, just ensures consistency between what's referenced in the toc
- and what is created. This is the variant with pep420 disabled.
+ directories with empty __init__.py and and nothing else should be
+ skipped, just ensures consistency between what's referenced in the toc
+ and what is created. This is the variant with pep420 disabled.
"""
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
@@ -379,7 +378,7 @@ def extract_toc(path):
)
def test_subpackage_in_toc(make_app, apidoc):
"""Make sure that empty subpackages with non-empty subpackages in them
- are not skipped (issue #4520)
+ are not skipped (issue #4520)
"""
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
@@ -643,7 +642,6 @@ def test_no_duplicates(rootdir, tmp_path):
We can't use pytest.mark.apidoc here as we use a different set of arguments
to apidoc_main
"""
-
original_suffixes = sphinx.ext.apidoc.PY_SUFFIXES
try:
# Ensure test works on Windows