def end_event(self, event, context): now = time.time() name = uniform_description(context) duration = now - self.event_start if self.threshold and duration < self.threshold: self.event_start = now return if self.pretty_output: self.output.write("{time:>-6,.2f} {event} {name}\n".format( event=event, name=name, time=duration, )) else: self.csv.writerow([ event, name, duration, self.event_start, ]) self.event_start = now if self.max_test_time is not None: limit = max(self.__dict__.pop("time_limit", 0), self.max_test_time) if duration > limit: raise AssertionError( f"{event} time limit ({limit}) exceeded: {duration}")
def end_event(self, event, context): now = time.time() name = uniform_description(context) if self.pretty_output: self.output.write("{time:>-6,.2f} {event} {name}\n".format( event=event, name=name, time=now - self.event_start, )) else: self.csv.writerow([ event, name, now - self.event_start, self.event_start, ]) self.event_start = now
def end_event(self, event, context): now = time.time() name = uniform_description(context) duration = now - self.event_start if self.threshold and duration < self.threshold: self.event_start = now return if self.pretty_output: self.output.write("{time:>-6,.2f} {event} {name}\n".format( event=event, name=name, time=duration, )) else: self.csv.writerow([ event, name, duration, self.event_start, ]) self.event_start = now