Skip to content

Commit 1883c0d

Browse files
Remove mypy overrides for tests.test_builders.test_build_html_numfig (sphinx-doc#13775)
1 parent 813bd3b commit 1883c0d

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ module = [
255255
"tests.test_builders.test_build_html_5_output",
256256
"tests.test_builders.test_build_html_assets",
257257
"tests.test_builders.test_build_html_maths",
258-
"tests.test_builders.test_build_html_numfig",
259258
"tests.test_builders.test_build_html_toctree",
260259
"tests.test_builders.test_build_linkcheck",
261260
# tests/test_directives

tests/test_builders/test_build_html_numfig.py

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
from tests.test_builders.xpath_util import check_xpath
1212

1313
if TYPE_CHECKING:
14+
from collections.abc import Callable
15+
from pathlib import Path
16+
from xml.etree.ElementTree import ElementTree
17+
1418
from sphinx.testing.util import SphinxTestApp
1519

1620

@@ -73,7 +77,14 @@ def test_numfig_disabled_warn(app: SphinxTestApp) -> None:
7377
)
7478
@pytest.mark.sphinx('html', testroot='numfig')
7579
@pytest.mark.test_params(shared_result='test_build_html_numfig')
76-
def test_numfig_disabled(app, cached_etree_parse, fname, path, check, be_found):
80+
def test_numfig_disabled(
81+
app: SphinxTestApp,
82+
cached_etree_parse: Callable[[Path], ElementTree],
83+
fname: str,
84+
path: str,
85+
check: str | None,
86+
be_found: bool,
87+
) -> None:
7788
app.build()
7889
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)
7990

@@ -305,8 +316,13 @@ def test_numfig_without_numbered_toctree_warn(app: SphinxTestApp) -> None:
305316
confoverrides={'numfig': True},
306317
)
307318
def test_numfig_without_numbered_toctree(
308-
app, cached_etree_parse, fname, path, check, be_found
309-
):
319+
app: SphinxTestApp,
320+
cached_etree_parse: Callable[[Path], ElementTree],
321+
fname: str,
322+
path: str,
323+
check: str | None,
324+
be_found: bool,
325+
) -> None:
310326
# remove :numbered: option
311327
index = (app.srcdir / 'index.rst').read_text(encoding='utf8')
312328
index = re.sub(':numbered:.*', '', index)
@@ -538,8 +554,13 @@ def test_numfig_with_numbered_toctree_warn(app: SphinxTestApp) -> None:
538554
)
539555
@pytest.mark.test_params(shared_result='test_build_html_numfig_on')
540556
def test_numfig_with_numbered_toctree(
541-
app, cached_etree_parse, fname, path, check, be_found
542-
):
557+
app: SphinxTestApp,
558+
cached_etree_parse: Callable[[Path], ElementTree],
559+
fname: str,
560+
path: str,
561+
check: str | None,
562+
be_found: bool,
563+
) -> None:
543564
app.build()
544565
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)
545566

@@ -780,7 +801,14 @@ def test_numfig_with_prefix_warn(app: SphinxTestApp) -> None:
780801
},
781802
)
782803
@pytest.mark.test_params(shared_result='test_build_html_numfig_format_warn')
783-
def test_numfig_with_prefix(app, cached_etree_parse, fname, path, check, be_found):
804+
def test_numfig_with_prefix(
805+
app: SphinxTestApp,
806+
cached_etree_parse: Callable[[Path], ElementTree],
807+
fname: str,
808+
path: str,
809+
check: str | None,
810+
be_found: bool,
811+
) -> None:
784812
app.build()
785813
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)
786814

@@ -1006,8 +1034,13 @@ def test_numfig_with_secnum_depth_warn(app: SphinxTestApp) -> None:
10061034
)
10071035
@pytest.mark.test_params(shared_result='test_build_html_numfig_depth_2')
10081036
def test_numfig_with_secnum_depth(
1009-
app, cached_etree_parse, fname, path, check, be_found
1010-
):
1037+
app: SphinxTestApp,
1038+
cached_etree_parse: Callable[[Path], ElementTree],
1039+
fname: str,
1040+
path: str,
1041+
check: str | None,
1042+
be_found: bool,
1043+
) -> None:
10111044
app.build()
10121045
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)
10131046

@@ -1103,6 +1136,10 @@ def test_numfig_with_secnum_depth(
11031136
confoverrides={'numfig': True},
11041137
)
11051138
@pytest.mark.test_params(shared_result='test_build_html_numfig_on')
1106-
def test_numfig_with_singlehtml(app, cached_etree_parse, expect):
1139+
def test_numfig_with_singlehtml(
1140+
app: SphinxTestApp,
1141+
cached_etree_parse: Callable[[Path], ElementTree],
1142+
expect: tuple[str, str, bool],
1143+
) -> None:
11071144
app.build()
11081145
check_xpath(cached_etree_parse(app.outdir / 'index.html'), 'index.html', *expect)

0 commit comments

Comments
 (0)