Skip to content

Commit 841b705

Browse files
authored
Merge branch 'master' into js-domain-parens
2 parents 9cea9e2 + 1a69059 commit 841b705

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

pyproject.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,7 @@ module = [
286286
"tests.test_transforms.test_transforms_post_transforms_images",
287287
"tests.test_transforms.test_transforms_reorder_nodes",
288288
# tests/test_util
289-
"tests.test_util.test_util",
290-
"tests.test_util.test_util_display",
291289
"tests.test_util.test_util_docutils",
292-
"tests.test_util.test_util_inventory",
293290
# tests/test_writers
294291
"tests.test_writers.test_docutilsconf",
295292
]
@@ -332,9 +329,6 @@ module = [
332329
"tests.test_extensions.test_ext_napoleon_docstring",
333330
# tests/test_intl
334331
"tests.test_intl.test_intl",
335-
# tests/test_pycode
336-
"tests.test_pycode.test_pycode",
337-
"tests.test_pycode.test_pycode_ast",
338332
# tests/test_transforms
339333
"tests.test_transforms.test_transforms_post_transforms",
340334
# tests/test_util

tests/test_pycode/test_pycode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_ModuleAnalyzer_for_file() -> None:
4141
assert analyzer.srcname == str(SPHINX_MODULE_PATH)
4242

4343

44-
def test_ModuleAnalyzer_for_module(rootdir):
44+
def test_ModuleAnalyzer_for_module(rootdir: Path) -> None:
4545
analyzer = ModuleAnalyzer.for_module('sphinx')
4646
assert analyzer.modname == 'sphinx'
4747
assert analyzer.srcname == str(SPHINX_MODULE_PATH)

tests/test_pycode/test_pycode_ast.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@
6565
('*tuple[str, int]', '*tuple[str, int]'), # Starred
6666
],
6767
) # fmt: skip
68-
def test_unparse(source, expected):
69-
module = ast.parse(source)
70-
assert ast_unparse(module.body[0].value, source) == expected
68+
def test_unparse(source: str, expected: str) -> None:
69+
expr = ast.parse(source).body[0]
70+
assert isinstance(expr, ast.Expr)
71+
assert ast_unparse(expr.value, source) == expected
7172

7273

7374
def test_unparse_None() -> None:

tests/test_util/test_util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

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

79
import sphinx.util
@@ -29,8 +31,11 @@
2931
relative_uri,
3032
)
3133

34+
if TYPE_CHECKING:
35+
from pathlib import Path
36+
3237

33-
def test_ensuredir(tmp_path):
38+
def test_ensuredir(tmp_path: Path) -> None:
3439
# Does not raise an exception for an existing directory.
3540
ensuredir(tmp_path)
3641

tests/test_util/test_util_display.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def test_status_iterator_length_0(app: SphinxTestApp) -> None:
4141

4242

4343
@pytest.mark.sphinx('dummy', testroot='root')
44-
def test_status_iterator_verbosity_0(app, monkeypatch):
44+
def test_status_iterator_verbosity_0(
45+
app: SphinxTestApp, monkeypatch: pytest.MonkeyPatch
46+
) -> None:
4547
monkeypatch.setenv('FORCE_COLOR', '1')
4648
logging.setup(app, app.status, app.warning)
4749

@@ -59,7 +61,9 @@ def test_status_iterator_verbosity_0(app, monkeypatch):
5961

6062

6163
@pytest.mark.sphinx('dummy', testroot='root')
62-
def test_status_iterator_verbosity_1(app, monkeypatch):
64+
def test_status_iterator_verbosity_1(
65+
app: SphinxTestApp, monkeypatch: pytest.MonkeyPatch
66+
) -> None:
6367
monkeypatch.setenv('FORCE_COLOR', '1')
6468
logging.setup(app, app.status, app.warning)
6569

@@ -107,7 +111,7 @@ def test_progress_message(app: SphinxTestApp) -> None:
107111

108112
# decorator
109113
@progress_message('testing')
110-
def func():
114+
def func() -> None:
111115
logger.info('in func ', nonl=True)
112116

113117
func()

tests/test_util/test_util_inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _build_inventory(srcdir: Path) -> Path:
107107
return app.outdir / 'objects.inv'
108108

109109

110-
def test_inventory_localization(tmp_path):
110+
def test_inventory_localization(tmp_path: Path) -> None:
111111
# Build an app using Estonian (EE) locale
112112
srcdir_et = _write_appconfig(tmp_path, 'et')
113113
inventory_et = _build_inventory(srcdir_et)

0 commit comments

Comments
 (0)