Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate unittest.TestCase.__init_subclass__ #13602

Merged
merged 1 commit into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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


# ===============================================================
Expand Down
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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


# ===============================================================
Expand Down
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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


# ===============================================================
Expand Down
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion stdlib/unittest/case.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down