@@ -194,7 +194,7 @@ def function_in_class_with_same_args(self, a, b, c, d):
194194 (False , '' ),
195195 (0 , '' ),
196196 ([], '' ),
197- ]
197+ ],
198198 )
199199def test_deindent_string (docstring , expects ):
200200 assert doctools .deindent_string (docstring ) == expects
@@ -210,13 +210,15 @@ def test_decorators():
210210
211211 # set_opening_hours and ceil should have extra text at the beginning
212212 assert (SpamCafe .set_opening_hours .__doc__ or '' ).startswith ("I will not buy this record, it is scratched." )
213- assert (doctools .deindent_string (SpamCafe .set_opening_hours .__doc__
214- )).endswith (doctools .deindent_string (Cafe .set_opening_hours .__doc__ ))
213+ assert (doctools .deindent_string (SpamCafe .set_opening_hours .__doc__ , )).endswith (
214+ doctools .deindent_string (Cafe .set_opening_hours .__doc__ )
215+ )
215216 # Dedented both strings to be sure of equivalence
216- assert (SpamCafe .ceil .__doc__ or ''
217- ).startswith ("I don't know why the cafe has a ceil function, but we'd better document it properly." , )
218- assert doctools .deindent_string (SpamCafe .ceil .__doc__
219- ).rstrip ().endswith (doctools .deindent_string (math .ceil .__doc__ ).rstrip ())
217+ assert (SpamCafe .ceil .__doc__ or
218+ '' ).startswith ("I don't know why the cafe has a ceil function, but we'd better document it properly." )
219+ assert doctools .deindent_string (SpamCafe .ceil .__doc__ , ).rstrip ().endswith (
220+ doctools .deindent_string (math .ceil .__doc__ ).rstrip ()
221+ )
220222 # Dedented both strings to be sure of equivalence
221223
222224 # Functions
@@ -225,18 +227,27 @@ def test_decorators():
225227
226228 if PEP_563 :
227229 assert undocumented_function .__annotations__ == {
228- 'a' : "float" , 'b' : "float" , 'c' : "float" , 'd' : "int" , "return" : "float"
230+ 'a' : "float" ,
231+ 'b' : "float" ,
232+ 'c' : "float" ,
233+ 'd' : "int" ,
234+ "return" : "float" ,
229235 }
230236 else :
231237 assert undocumented_function .__annotations__ == {
232- 'a' : float , 'b' : float , 'c' : float , 'd' : int , "return" : float
238+ 'a' : float ,
239+ 'b' : float ,
240+ 'c' : float ,
241+ 'd' : int ,
242+ "return" : float ,
233243 }
234244
235245 assert (partially_documented_function .__doc__ or '' ).startswith (
236- "This function works like ``documented_function`` except it returns the result telepathically."
246+ "This function works like ``documented_function`` except it returns the result telepathically." ,
247+ )
248+ assert (doctools .deindent_string (partially_documented_function .__doc__ , )).endswith (
249+ doctools .deindent_string (documented_function .__doc__ )
237250 )
238- assert (doctools .deindent_string (partially_documented_function .__doc__
239- )).endswith (doctools .deindent_string (documented_function .__doc__ ))
240251 # Dedented both strings to be sure of equivalence
241252 assert DummyClass .function_in_class_with_same_args .__doc__ == documented_function .__doc__
242253 assert DummyClass .function_in_class_with_same_args .__name__ == "function_in_class_with_same_args"
0 commit comments