Mark base node classes as ABCs #11676
Labels
topic: collection
related to the collection phase
topic: typing
type-annotation issue
type: backward compatibility
might present some backward compatibility issues which should be carefully noted in the changelog
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
The Node class hierarchy has some classes which are only meant to be used as base classes, never instantiated directly. These are
Node
,Collector
,Item
,File
,FSCollector
,PyCollector
.I propose we mark them as abstract i.e. inherit from
abc.ABC
. Reasons:abstractmethod
on the abstract methods that need to be implemented (collect
orruntest
), and show inheritance fromABC
making it clear it's a base classIt seems somewhat hard to deprecate, and it will only cause errors when the code is already very wrong. So I propose to do it in pytest 8.0 without deprecation.
The text was updated successfully, but these errors were encountered: