def cls(self):
        """Python class object this node was collected from (can be None)."""
        node = self.getparent(Class)
        return node.obj if node is not None else None
Python class object this node was collected from (can be None).
src/_pytest/python.py