def METHOD_NAME(self, mock_run):
    def side_effect():
        raise Exception("Something went wrong")
    mock_run.side_effect = side_effect
    with self._caplog.at_level(logging.WARNING):
        CommandCapabilities.check_version(
            'command_that_fails', (1, 2), raise_on_error=False
        )