def summary(self):
        """ Display the tests results.

        Called at the end of self.run()
        Sets ``self.ok``

        """
        if not self.tests:
            self.ok = False
            return
        num_tests = len(self.results)
        failures = [x for x in self.results.values() if x.ok is False]
        num_failed = len(failures)
        message = (num_tests, self.elapsed_time) % "Ran %i tests in %is"
        ui.info(message)
        self.ok = (not failures) and not self._interrupted
        if self.ok:
            ui.info(ui.green, "All pass. Congrats!")
        else:
            if num_failed != 0:
                ui.error(num_failed, "failures")
            if failures:
                max_len = max(len(x.test["name"]) for x in failures)
                for i, failure in enumerate(failures):
                    ui.info_count(i, num_failed,
                                ui.blue, failure.test["name"].ljust(max_len + 2),
                                ui.reset, *failure.message)
        self.write_failures(failures)
        errors = [x for x in failures if x.error]
        if errors:
            # No need to display more errors
            raise qisys.error.Error("Unexpected errors occurred during tests")
dataset/ETHPy150Open aldebaran/qibuild/python/qitest/test_queue.py/TestQueue.summary/swapped operands of `%`