Skip to content

Commit 20aad6d

Browse files
author
daniel.eades
committed
fixup
1 parent d73d5b1 commit 20aad6d

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ module = [
231231
"tests.test_domains.test_domain_py_fields",
232232
"tests.test_domains.test_domain_py_pyfunction",
233233
"tests.test_domains.test_domain_py_pyobject",
234-
"tests.test_domains.test_domain_rst",
235234
"tests.test_domains.test_domain_std",
236235
# tests/test_environment
237236
"tests.test_environment.test_environment_toctree",

tests/test_domains/test_domain_rst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_rst_directive_option_type(app: SphinxTestApp) -> None:
225225

226226

227227
@pytest.mark.sphinx('html', testroot='_blank')
228-
def test_rst_directive_and_directive_option(app):
228+
def test_rst_directive_and_directive_option(app: SphinxTestApp) -> None:
229229
text = '.. rst:directive:: foo\n\n .. rst:directive:option:: bar\n'
230230
doctree = restructuredtext.parse(app, text)
231231
assert_node(

tests/test_util/test_util_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ def meth(self):
999999

10001000
def test_is_builtin_class_method() -> None:
10011001
class MyInt(int):
1002-
def my_method(self):
1002+
def my_method(self) -> None:
10031003
pass
10041004

10051005
assert inspect.is_builtin_class_method(MyInt, 'to_bytes')

tests/test_util/test_util_nodes.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from textwrap import dedent
6-
from typing import TYPE_CHECKING, Any
6+
from typing import TYPE_CHECKING, Any, cast
77

88
import pytest
99
from docutils import frontend, nodes
@@ -23,7 +23,9 @@
2323
if TYPE_CHECKING:
2424
from collections.abc import Iterable
2525

26-
from docutils.nodes import document
26+
from docutils.nodes import Element, document
27+
28+
from sphinx.testing.util import SphinxTestApp
2729

2830

2931
def _transform(doctree: nodes.document) -> None:
@@ -225,16 +227,18 @@ def test_make_id(app, prefix, term, expected):
225227

226228

227229
@pytest.mark.sphinx('html', testroot='root')
228-
def test_make_id_already_registered(app):
230+
def test_make_id_already_registered(app: SphinxTestApp) -> None:
229231
document = create_new_document()
230-
document.ids['term-Sphinx'] = True # register "term-Sphinx" manually
232+
document.ids['term-Sphinx'] = cast(
233+
'Element', True
234+
) # register "term-Sphinx" manually
231235
assert make_id(app.env, document, 'term', 'Sphinx') == 'term-0'
232236

233237

234238
@pytest.mark.sphinx('html', testroot='root')
235-
def test_make_id_sequential(app):
239+
def test_make_id_sequential(app: SphinxTestApp) -> None:
236240
document = create_new_document()
237-
document.ids['term-0'] = True
241+
document.ids['term-0'] = cast('Element', True)
238242
assert make_id(app.env, document, 'term') == 'term-1'
239243

240244

@@ -249,7 +253,7 @@ def test_make_id_sequential(app):
249253
('hello <world> <sphinx>', (True, 'hello <world>', 'sphinx')),
250254
],
251255
)
252-
def test_split_explicit_target(title, expected):
256+
def test_split_explicit_target(title: str, expected: tuple[bool, str, str]) -> None:
253257
assert split_explicit_title(title) == expected
254258

255259

0 commit comments

Comments
 (0)