def _format_slow_test(self, example): seconds = total_seconds(example.elapsed_time) color_name = None if seconds > self.settings.slow_test_threshold: color_name = 'yellow' if seconds > 5 * self.settings.slow_test_threshold: color_name = 'red' if color_name is not None: return self._color(color_name, ' (' + self._format_duration(example.elapsed_time) + ')') return ''
def _format_slow_test(self, example): seconds = total_seconds(example.elapsed_time) color_name = None if seconds > self.settings.slow_test_threshold: color_name = 'yellow' if seconds > 5 * self.settings.slow_test_threshold: color_name = 'red' if color_name is not None: return self._color( color_name, ' (' + self._format_duration(example.elapsed_time) + ')') return ''
def _format_duration(self, duration): return '%.4f seconds' % total_seconds(duration)