@@ -27,8 +27,7 @@ class ModuleAnchorMixin:
27
27
28
28
class FunctionalAPIBase :
29
29
def _gen_resourcetxt_path_parts (self ):
30
- """Yield various names of a text file in anchor02, each in a subTest
31
- """
30
+ """Yield various names of a text file in anchor02, each in a subTest"""
32
31
for path_parts in (
33
32
('subdirectory' , 'subsubdir' , 'resource.txt' ),
34
33
('subdirectory/subsubdir/resource.txt' ,),
@@ -44,15 +43,20 @@ def test_read_text(self):
44
43
)
45
44
self .assertEqual (
46
45
resources .read_text (
47
- self .anchor02 , 'subdirectory' , 'subsubdir' , 'resource.txt' ,
46
+ self .anchor02 ,
47
+ 'subdirectory' ,
48
+ 'subsubdir' ,
49
+ 'resource.txt' ,
48
50
encoding = 'utf-8' ,
49
51
),
50
52
'a resource' ,
51
53
)
52
54
for path_parts in self ._gen_resourcetxt_path_parts ():
53
55
self .assertEqual (
54
56
resources .read_text (
55
- self .anchor02 , * path_parts , encoding = 'utf-8' ,
57
+ self .anchor02 ,
58
+ * path_parts ,
59
+ encoding = 'utf-8' ,
56
60
),
57
61
'a resource' ,
58
62
)
@@ -99,7 +103,8 @@ def test_open_text(self):
99
103
self .assertEqual (f .read (), 'Hello, UTF-8 world!\n ' )
100
104
for path_parts in self ._gen_resourcetxt_path_parts ():
101
105
with resources .open_text (
102
- self .anchor02 , * path_parts ,
106
+ self .anchor02 ,
107
+ * path_parts ,
103
108
encoding = 'utf-8' ,
104
109
) as f :
105
110
self .assertEqual (f .read (), 'a resource' )
@@ -135,7 +140,8 @@ def test_open_binary(self):
135
140
self .assertEqual (f .read (), b'Hello, UTF-8 world!\n ' )
136
141
for path_parts in self ._gen_resourcetxt_path_parts ():
137
142
with resources .open_binary (
138
- self .anchor02 , * path_parts ,
143
+ self .anchor02 ,
144
+ * path_parts ,
139
145
) as f :
140
146
self .assertEqual (f .read (), b'a resource' )
141
147
@@ -213,18 +219,24 @@ def test_text_errors(self):
213
219
# Multiple path arguments need explicit encoding argument.
214
220
with self .assertRaises (TypeError ):
215
221
func (
216
- self .anchor02 , 'subdirectory' ,
217
- 'subsubdir' , 'resource.txt' ,
222
+ self .anchor02 ,
223
+ 'subdirectory' ,
224
+ 'subsubdir' ,
225
+ 'resource.txt' ,
218
226
)
219
227
220
228
221
229
class FunctionalAPITest_StringAnchor (
222
- unittest .TestCase , FunctionalAPIBase , StringAnchorMixin ,
230
+ unittest .TestCase ,
231
+ FunctionalAPIBase ,
232
+ StringAnchorMixin ,
223
233
):
224
234
pass
225
235
226
236
227
237
class FunctionalAPITest_ModuleAnchor (
228
- unittest .TestCase , FunctionalAPIBase , ModuleAnchorMixin ,
238
+ unittest .TestCase ,
239
+ FunctionalAPIBase ,
240
+ ModuleAnchorMixin ,
229
241
):
230
242
pass
0 commit comments