@@ -207,7 +207,7 @@ def test_natlang_array_invalid_shape(self, shape):
207207 doctype = f"array of shape { shape } "
208208 transformer = DoctypeTransformer ()
209209 with pytest .raises (lark .exceptions .UnexpectedInput ):
210- transformer .doctype_to_annotation (doctype )
210+ _ = transformer .doctype_to_annotation (doctype )
211211
212212 def test_unknown_name (self ):
213213 # Simple unknown name is aliased to typing.Any
@@ -302,6 +302,7 @@ def test_returns(self, doctypes, expected):
302302 ).format (* doctypes )
303303 transformer = DoctypeTransformer ()
304304 annotations = DocstringAnnotations (docstring , transformer = transformer )
305+ assert annotations .returns is not None
305306 assert annotations .returns .value == expected
306307
307308 def test_yields (self , caplog ):
@@ -315,6 +316,7 @@ def test_yields(self, caplog):
315316 )
316317 transformer = DoctypeTransformer ()
317318 annotations = DocstringAnnotations (docstring , transformer = transformer )
319+ assert annotations .returns is not None
318320 assert annotations .returns .value == "Generator[tuple[int, str]]"
319321 assert annotations .returns .imports == {
320322 KnownImport (import_path = "collections.abc" , import_name = "Generator" )
@@ -336,6 +338,7 @@ def test_receives(self, caplog):
336338 )
337339 transformer = DoctypeTransformer ()
338340 annotations = DocstringAnnotations (docstring , transformer = transformer )
341+ assert annotations .returns is not None
339342 assert (
340343 annotations .returns .value
341344 == "Generator[tuple[int, str], tuple[float, bytes]]"
@@ -364,6 +367,7 @@ def test_full_generator(self, caplog):
364367 )
365368 transformer = DoctypeTransformer ()
366369 annotations = DocstringAnnotations (docstring , transformer = transformer )
370+ assert annotations .returns is not None
367371 assert annotations .returns .value == (
368372 "Generator[tuple[int, str], tuple[float, bytes], bool]"
369373 )
@@ -386,6 +390,7 @@ def test_yields_and_returns(self, caplog):
386390 )
387391 transformer = DoctypeTransformer ()
388392 annotations = DocstringAnnotations (docstring , transformer = transformer )
393+ assert annotations .returns is not None
389394 assert annotations .returns .value == ("Generator[tuple[int, str], None, bool]" )
390395 assert annotations .returns .imports == {
391396 KnownImport (import_path = "collections.abc" , import_name = "Generator" )
@@ -416,6 +421,8 @@ def test_duplicate_returns(self, caplog):
416421 )
417422 transformer = DoctypeTransformer ()
418423 annotations = DocstringAnnotations (docstring , transformer = transformer )
424+ assert annotations .returns is not None
425+ assert annotations .returns is not None
419426 assert annotations .returns .value == "int"
420427
421428 def test_args_kwargs (self ):
0 commit comments