This should use `self.patch` rather than setting and later restoring manually.