def instance(self):
        """Instance (can be None) on which test function was collected."""
        if self.scope != "function":
            return None
        return getattr(self._pyfuncitem, "instance", None)
Instance (can be None) on which test function was collected.
src/_pytest/fixtures.py