Annotate unittest.TestCase.__init_subclass__ (#13602)

This commit is contained in:
Joren Hammudoglu
2025-03-09 13:47:43 +01:00
committed by GitHub
parent 846d167f51
commit ab46a26de8
5 changed files with 5 additions and 9 deletions
@@ -164,8 +164,6 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ===============================================================
@@ -145,8 +145,6 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ===============================================================
@@ -157,8 +157,6 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ===============================================================
@@ -147,5 +147,3 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
+5 -1
View File
@@ -20,7 +20,7 @@ from typing import (
TypeVar,
overload,
)
from typing_extensions import ParamSpec, Self, TypeAlias
from typing_extensions import Never, ParamSpec, Self, TypeAlias
from warnings import WarningMessage
if sys.version_info >= (3, 9):
@@ -323,6 +323,10 @@ class TestCase:
self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = None
) -> None: ...
if sys.version_info >= (3, 10):
# Runtime has *args, **kwargs, but will error if any are supplied
def __init_subclass__(cls, *args: Never, **kwargs: Never) -> None: ...
class FunctionTestCase(TestCase):
def __init__(
self,