Run post-upgrade checks after applying all pending upgrades.

        Post checks may be used to emit warnings encountered when applying an
        upgrade, but post-checks can also be used to advice the user to run
        re-indexing or similar long running processes.

        Post-checks may query for user-input, but should respect the
        --yes-i-know option to run in an unattended mode.

        All applied upgrades post-checks are executed.

        :param upgrades: List of upgrades sorted in topological order.

def post_upgrade_checks(self, upgrades):
        """Run post-upgrade checks after applying all pending upgrades.

        Post checks may be used to emit warnings encountered when applying an
        upgrade, but post-checks can also be used to advice the user to run
        re-indexing or similar long running processes.

        Post-checks may query for user-input, but should respect the
        --yes-i-know option to run in an unattended mode.

        All applied upgrades post-checks are executed.

        :param upgrades: List of upgrades sorted in topological order.
        """
        errors = []

        for u in upgrades:
            self._setup_log_prefix(plugin_id=u.name)
            try:
                u.post_upgrade()
            except RuntimeError as e:
                errors.append((u.name, e.args))

        for check in self.global_post_upgrade:
            self._setup_log_prefix(plugin_id=check.__name__)
            try:
                check()
            except RuntimeError as e:
                errors.append((check.__name__, e.args))

        self._teardown_log_prefix()

        self._check_errors(errors, "Post-upgrade check for %s failed with the "
                           "following errors:")