Fix a lot of test related typing issues

This commit is contained in:
Dave Halter
2026-02-10 19:38:55 +01:00
parent 6903bc25d5
commit 8cbb817b12
20 changed files with 47 additions and 40 deletions
+4 -4
View File
@@ -56,10 +56,10 @@ def test_generics_methods(code, expected, class_findable):
class Reader(Generic[T]):
@classmethod
def read(cls) -> T:
return cls()
return cls() # type: ignore[return-value]
def method(self) -> T:
return 1
return 1 # type: ignore[return-value]
class Foo(Reader[str]):
def transform(self) -> int:
@@ -94,7 +94,7 @@ def test_signature():
pass
from inspect import Signature, Parameter
some_signature.__signature__ = Signature([
some_signature.__signature__ = Signature([ # type: ignore[attr-defined]
Parameter('bar', kind=Parameter.KEYWORD_ONLY, default=1)
])
@@ -105,7 +105,7 @@ def test_signature():
def test_compiled_signature_annotation_string():
import typing
def func(x: typing.Type, y: typing.Union[typing.Type, int]):
def func(x: typing.Type, y: typing.Union[typing.Type, int]): # type: ignore[type-arg]
pass
func.__name__ = 'not_func'