12
12
from sphinx ._cli .util .errors import strip_escape_sequences
13
13
from sphinx .jinja2glue import BuiltinTemplateLoader
14
14
from sphinx .util .fileutil import _template_basename , copy_asset , copy_asset_file
15
+ from sphinx .util .template import BaseRenderer
15
16
16
17
if TYPE_CHECKING :
17
18
from sphinx .testing .util import SphinxTestApp
18
19
19
20
20
- class DummyTemplateLoader (BuiltinTemplateLoader ):
21
+ class DummyTemplateLoader (BuiltinTemplateLoader , BaseRenderer ):
21
22
def __init__ (self ) -> None :
22
23
super ().__init__ ()
23
24
builder = mock .Mock ()
@@ -26,7 +27,7 @@ def __init__(self) -> None:
26
27
self .init (builder )
27
28
28
29
29
- def test_copy_asset_file (tmp_path ) :
30
+ def test_copy_asset_file (tmp_path : Path ) -> None :
30
31
renderer = DummyTemplateLoader ()
31
32
32
33
# copy normal file
@@ -69,7 +70,7 @@ def test_copy_asset_file(tmp_path):
69
70
assert (subdir2 / 'asset.txt.jinja' ).read_text (encoding = 'utf8' ) == '# {{var1}} data'
70
71
71
72
72
- def test_copy_asset (tmp_path ) :
73
+ def test_copy_asset (tmp_path : Path ) -> None :
73
74
renderer = DummyTemplateLoader ()
74
75
75
76
# prepare source files
@@ -113,7 +114,7 @@ def test_copy_asset(tmp_path):
113
114
assert sidebar == 'sidebar: baz'
114
115
115
116
# copy with exclusion
116
- def excluded (path ) :
117
+ def excluded (path : str ) -> bool :
117
118
return 'sidebar.html' in path or 'basic.css' in path
118
119
119
120
destdir = tmp_path / 'test3'
0 commit comments