mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 09:00:00 -06:00
Remove mypy overrides for `tests/test_builders/test_build_html_tocdepth.py` (#13696)
This commit is contained in:
1 parent
8949df498f
commit
ca794cbe06
2 files changed
+22
-3
No files matched your search
@@ -2,11 +2,20 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_builders.xpath_html_util import _intradocument_hyperlink_check
|
||||
from tests.test_builders.xpath_util import check_xpath
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from xml.etree.ElementTree import ElementTree
|
||||
|
||||
from sphinx.testing.util import SphinxTestApp
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('fname', 'path', 'check', 'be_found'),
|
||||
@@ -68,7 +77,14 @@ from tests.test_builders.xpath_util import check_xpath
|
||||
)
|
||||
@pytest.mark.sphinx('html', testroot='tocdepth')
|
||||
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
|
||||
def test_tocdepth(app, cached_etree_parse, fname, path, check, be_found):
|
||||
def test_tocdepth(
|
||||
app: SphinxTestApp,
|
||||
cached_etree_parse: Callable[[Path], ElementTree],
|
||||
fname: str,
|
||||
path: str,
|
||||
check: str,
|
||||
be_found: bool,
|
||||
) -> None:
|
||||
app.build()
|
||||
# https://github.com/sphinx-doc/sphinx/issues/1251
|
||||
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):
|
||||
)
|
||||
@pytest.mark.sphinx('singlehtml', testroot='tocdepth')
|
||||
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
|
||||
def test_tocdepth_singlehtml(app, cached_etree_parse, expect):
|
||||
def test_tocdepth_singlehtml(
|
||||
app: SphinxTestApp,
|
||||
cached_etree_parse: Callable[[Path], ElementTree],
|
||||
expect: tuple[str, str, bool],
|
||||
) -> None:
|
||||
app.build()
|
||||
check_xpath(cached_etree_parse(app.outdir / 'index.html'), 'index.html', *expect)
|
||||
Reference in new issue
Block a user