Skip to content

Commit ca794cb

Browse files
Remove mypy overrides for tests/test_builders/test_build_html_tocdepth.py (#13696)
1 parent 8949df4 commit ca794cb

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ module = [
257257
"tests.test_builders.test_build_html_assets",
258258
"tests.test_builders.test_build_html_maths",
259259
"tests.test_builders.test_build_html_numfig",
260-
"tests.test_builders.test_build_html_tocdepth",
261260
"tests.test_builders.test_build_html_toctree",
262261
"tests.test_builders.test_build_linkcheck",
263262
"tests.test_builders.test_build_warnings",

tests/test_builders/test_build_html_tocdepth.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
from __future__ import annotations
44

5+
from typing import TYPE_CHECKING
6+
57
import pytest
68

79
from tests.test_builders.xpath_html_util import _intradocument_hyperlink_check
810
from tests.test_builders.xpath_util import check_xpath
911

12+
if TYPE_CHECKING:
13+
from collections.abc import Callable
14+
from pathlib import Path
15+
from xml.etree.ElementTree import ElementTree
16+
17+
from sphinx.testing.util import SphinxTestApp
18+
1019

1120
@pytest.mark.parametrize(
1221
('fname', 'path', 'check', 'be_found'),
@@ -68,7 +77,14 @@
6877
)
6978
@pytest.mark.sphinx('html', testroot='tocdepth')
7079
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
71-
def test_tocdepth(app, cached_etree_parse, fname, path, check, be_found):
80+
def test_tocdepth(
81+
app: SphinxTestApp,
82+
cached_etree_parse: Callable[[Path], ElementTree],
83+
fname: str,
84+
path: str,
85+
check: str,
86+
be_found: bool,
87+
) -> None:
7288
app.build()
7389
# https://github.com/sphinx-doc/sphinx/issues/1251
7490
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)
@@ -111,6 +127,10 @@ def test_tocdepth(app, cached_etree_parse, fname, path, check, be_found):
111127
)
112128
@pytest.mark.sphinx('singlehtml', testroot='tocdepth')
113129
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
114-
def test_tocdepth_singlehtml(app, cached_etree_parse, expect):
130+
def test_tocdepth_singlehtml(
131+
app: SphinxTestApp,
132+
cached_etree_parse: Callable[[Path], ElementTree],
133+
expect: tuple[str, str, bool],
134+
) -> None:
115135
app.build()
116136
check_xpath(cached_etree_parse(app.outdir / 'index.html'), 'index.html', *expect)

0 commit comments

Comments
 (0)