'instance (can be None) on which test function was collected.'

@property
def instance(self):

    try:
        return self._pyfuncitem._testcase
    except AttributeError:
        function = getattr(self, 'function', None)
        if (function is not None):
            return py.builtin._getimself(function)
