-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
topic: typingtype-annotation issuetype-annotation issuetype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
What's the problem this feature will solve?
currently, there is no way to type check your hook functions:
from pytest import Item
def pytest_runtestloop(session: Item): # no type error, it should be Session
...
Describe the solution you'd like
expose a base class for plugins to extend, so they can be defined like so:
from typing_extensions import override
from pytest import Plugin
class SomePlugin(Plugin):
@override
def pytest_runtestloop(self, session: Item): # type error: signature does not match base method
...
Alternative Solutions
Additional context
KotlinIsland and ssbarnea
Metadata
Metadata
Assignees
Labels
topic: typingtype-annotation issuetype-annotation issuetype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature