Skip to content

Commit 815f99b

Browse files
Remove mypy overrides for tests/test_writers/test_docutilsconf.py (#14069)
1 parent 2ee17b6 commit 815f99b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ module = [
246246
"tests.test_theming.test_theming",
247247
# tests/test_transforms
248248
"tests.test_transforms.test_transforms_post_transforms_images",
249-
# tests/test_writers
250-
"tests.test_writers.test_docutilsconf",
251249
]
252250
disallow_untyped_defs = false
253251

tests/test_writers/test_docutilsconf.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@
22

33
from __future__ import annotations
44

5+
from typing import TYPE_CHECKING
6+
57
import pytest
68
from docutils import nodes
79

810
from sphinx.testing.util import assert_node
911
from sphinx.util.docutils import patch_docutils
1012

13+
if TYPE_CHECKING:
14+
from sphinx.application import Sphinx
15+
1116

1217
@pytest.mark.sphinx(
1318
'dummy',
1419
testroot='docutilsconf',
1520
freshenv=True,
1621
)
17-
def test_html_with_default_docutilsconf(app):
22+
def test_html_with_default_docutilsconf(app: Sphinx) -> None:
1823
with patch_docutils(app.confdir):
1924
app.build()
2025

2126
doctree = app.env.get_doctree('index')
27+
section = doctree[0]
28+
assert isinstance(section, nodes.Element)
2229
assert_node(
23-
doctree[0][1], [nodes.paragraph, ('Sphinx ', [nodes.footnote_reference, '1'])]
30+
section[1], [nodes.paragraph, ('Sphinx ', [nodes.footnote_reference, '1'])]
2431
)
2532

2633

@@ -31,11 +38,13 @@ def test_html_with_default_docutilsconf(app):
3138
docutils_conf='[restructuredtext parser]\ntrim_footnote_reference_space: true\n',
3239
copy_test_root=True,
3340
)
34-
def test_html_with_docutilsconf(app):
41+
def test_html_with_docutilsconf(app: Sphinx) -> None:
3542
with patch_docutils(app.confdir):
3643
app.build()
3744

3845
doctree = app.env.get_doctree('index')
46+
section = doctree[0]
47+
assert isinstance(section, nodes.Element)
3948
assert_node(
40-
doctree[0][1], [nodes.paragraph, ('Sphinx', [nodes.footnote_reference, '1'])]
49+
section[1], [nodes.paragraph, ('Sphinx', [nodes.footnote_reference, '1'])]
4150
)

0 commit comments

Comments
 (0)