Skip to content

Commit 4dbdf80

Browse files
Remove mypy overrides for test_util_fileutil (#13552)
1 parent ee0e576 commit 4dbdf80

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ module = [
338338
# tests/test_transforms
339339
"tests.test_transforms.test_transforms_post_transforms",
340340
# tests/test_util
341-
"tests.test_util.test_util_fileutil",
342341
"tests.test_util.test_util_i18n",
343342
"tests.test_util.test_util_inspect",
344343
"tests.test_util.test_util_logging",

tests/test_util/test_util_fileutil.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
from sphinx._cli.util.errors import strip_escape_sequences
1313
from sphinx.jinja2glue import BuiltinTemplateLoader
1414
from sphinx.util.fileutil import _template_basename, copy_asset, copy_asset_file
15+
from sphinx.util.template import BaseRenderer
1516

1617
if TYPE_CHECKING:
1718
from sphinx.testing.util import SphinxTestApp
1819

1920

20-
class DummyTemplateLoader(BuiltinTemplateLoader):
21+
class DummyTemplateLoader(BuiltinTemplateLoader, BaseRenderer):
2122
def __init__(self) -> None:
2223
super().__init__()
2324
builder = mock.Mock()
@@ -26,7 +27,7 @@ def __init__(self) -> None:
2627
self.init(builder)
2728

2829

29-
def test_copy_asset_file(tmp_path):
30+
def test_copy_asset_file(tmp_path: Path) -> None:
3031
renderer = DummyTemplateLoader()
3132

3233
# copy normal file
@@ -69,7 +70,7 @@ def test_copy_asset_file(tmp_path):
6970
assert (subdir2 / 'asset.txt.jinja').read_text(encoding='utf8') == '# {{var1}} data'
7071

7172

72-
def test_copy_asset(tmp_path):
73+
def test_copy_asset(tmp_path: Path) -> None:
7374
renderer = DummyTemplateLoader()
7475

7576
# prepare source files
@@ -113,7 +114,7 @@ def test_copy_asset(tmp_path):
113114
assert sidebar == 'sidebar: baz'
114115

115116
# copy with exclusion
116-
def excluded(path):
117+
def excluded(path: str) -> bool:
117118
return 'sidebar.html' in path or 'basic.css' in path
118119

119120
destdir = tmp_path / 'test3'

0 commit comments

Comments
 (0)