Closed
Description
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:
- Trying to instantiate fails quickly at runtime
- Type checkers issue an error if trying to instantiate
- The docs will show
abstractmethod
on the abstract methods that need to be implemented (collect
orruntest
), and show inheritance fromABC
making it clear it's a base class
It 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.