Skip to content

Commit

Permalink
apidoc: Rename test roots
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jan 7, 2025
1 parent 8e6883f commit 74ec220
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions tests/test_extensions/test_ext_apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def test_simple(make_app, apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-custom-templates',
coderoot='test-ext-apidoc-custom-templates',
options=[
'--separate',
'--templatedir=tests/roots/test-apidoc-custom-templates/_templates',
'--templatedir=tests/roots/test-ext-apidoc-custom-templates/_templates',
],
)
def test_custom_templates(make_app, apidoc):
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_custom_templates(make_app, apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
options=['--implicit-namespaces'],
)
def test_pep_0420_enabled(make_app, apidoc):
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_pep_0420_enabled(make_app, apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
options=['--implicit-namespaces', '--separate'],
)
def test_pep_0420_enabled_separate(make_app, apidoc):
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_pep_0420_enabled_separate(make_app, apidoc):
assert 'a.b.x namespace\n' in txt


@pytest.mark.apidoc(coderoot='test-apidoc-pep420/a')
@pytest.mark.apidoc(coderoot='test-ext-apidoc-pep420/a')
def test_pep_0420_disabled(make_app, apidoc):
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
Expand All @@ -205,7 +205,7 @@ def test_pep_0420_disabled(make_app, apidoc):
print(app._warning.getvalue())


@pytest.mark.apidoc(coderoot='test-apidoc-pep420/a/b')
@pytest.mark.apidoc(coderoot='test-ext-apidoc-pep420/a/b')
def test_pep_0420_disabled_top_level_verify(make_app, apidoc):
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
Expand All @@ -224,7 +224,7 @@ def test_pep_0420_disabled_top_level_verify(make_app, apidoc):
print(app._warning.getvalue())


@pytest.mark.apidoc(coderoot='test-apidoc-trailing-underscore')
@pytest.mark.apidoc(coderoot='test-ext-apidoc-trailing-underscore')
def test_trailing_underscore(make_app, apidoc):
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()
Expand All @@ -243,7 +243,7 @@ def test_trailing_underscore(make_app, apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
excludes=['b/c/d.py', 'b/e/f.py', 'b/e/__init__.py'],
options=['--implicit-namespaces', '--separate'],
)
Expand All @@ -261,7 +261,7 @@ def test_excludes(apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
excludes=['b/e'],
options=['--implicit-namespaces', '--separate'],
)
Expand All @@ -278,7 +278,7 @@ def test_excludes_subpackage_should_be_skipped(apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
excludes=['b/e/f.py'],
options=['--implicit-namespaces', '--separate'],
)
Expand All @@ -295,7 +295,7 @@ def test_excludes_module_should_be_skipped(apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-pep420/a',
coderoot='test-ext-apidoc-pep420/a',
excludes=[],
options=['--implicit-namespaces', '--separate'],
)
Expand Down Expand Up @@ -353,7 +353,7 @@ def test_extension_parsed(apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-toc/mypackage',
coderoot='test-ext-apidoc-toc/mypackage',
options=['--implicit-namespaces'],
)
def test_toc_all_references_should_exist_pep420_enabled(apidoc):
Expand Down Expand Up @@ -385,7 +385,7 @@ def test_toc_all_references_should_exist_pep420_enabled(apidoc):


@pytest.mark.apidoc(
coderoot='test-apidoc-toc/mypackage',
coderoot='test-ext-apidoc-toc/mypackage',
)
def test_toc_all_references_should_exist_pep420_disabled(apidoc):
"""All references in toc should exist. This test doesn't say if
Expand Down Expand Up @@ -432,7 +432,7 @@ def extract_toc(path):


@pytest.mark.apidoc(
coderoot='test-apidoc-subpackage-in-toc',
coderoot='test-ext-apidoc-subpackage-in-toc',
options=['--separate'],
)
def test_subpackage_in_toc(apidoc):
Expand Down Expand Up @@ -733,7 +733,7 @@ def test_no_duplicates(rootdir, tmp_path):
# Ensure test works on Windows
sphinx.ext.apidoc._generate.PY_SUFFIXES += ('.so',)

package = rootdir / 'test-apidoc-duplicates' / 'fish_licence'
package = rootdir / 'test-ext-apidoc-duplicates' / 'fish_licence'
outdir = tmp_path / 'out'
apidoc_main(['-o', str(outdir), '-T', str(package), '--implicit-namespaces'])

Expand Down
18 changes: 15 additions & 3 deletions tests/test_extensions/test_ext_autosummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ def test_extract_summary(capsys):
assert err == ''


@pytest.mark.sphinx('dummy', testroot='autosummary', confoverrides=defaults.copy())
@pytest.mark.sphinx(
'dummy',
testroot='ext-autosummary-ext',
confoverrides=defaults.copy(),
)
def test_get_items_summary(make_app, app_params):
import sphinx.ext.autosummary
import sphinx.ext.autosummary.generate
Expand Down Expand Up @@ -219,7 +223,11 @@ def str_content(elem: Element) -> str:
return ''.join(str_content(e) for e in elem)


@pytest.mark.sphinx('xml', testroot='autosummary', confoverrides=defaults.copy())
@pytest.mark.sphinx(
'xml',
testroot='ext-autosummary-ext',
confoverrides=defaults.copy(),
)
def test_escaping(app):
app.build(force_all=True)

Expand Down Expand Up @@ -744,7 +752,11 @@ def test_autosummary_filename_map(app):
assert html_warnings == ''


@pytest.mark.sphinx('latex', testroot='autosummary', confoverrides=defaults.copy())
@pytest.mark.sphinx(
'latex',
testroot='ext-autosummary-ext',
confoverrides=defaults.copy(),
)
def test_autosummary_latex_table_colspec(app):
app.build(force_all=True)
result = (app.outdir / 'projectnamenotset.tex').read_text(encoding='utf8')
Expand Down

0 comments on commit 74ec220

Please sign in to comment.