'class (can be None) where the test function was collected.'

@scopeproperty('class')
def cls(self):

    clscol = self._pyfuncitem.getparent(_pytest.python.Class)
    if clscol:
        return clscol.obj
