(self, test)
| 460 | return super(TimeCostTextTestResult, self).startTest(test) |
| 461 | |
| 462 | def stopTest(self, test): |
| 463 | TextTestResult.stopTest(self, test) |
| 464 | test.stop_time = datetime.datetime.now() |
| 465 | test.time_cost = (test.stop_time - test.start_time).total_seconds() |
| 466 | self.stream.writeln('Test case: %s stop at: %s, cost time: %s(seconds)' % |
| 467 | (test.test_full_name, test.stop_time, test.time_cost)) |
| 468 | if torch.cuda.is_available() and test.time_cost > 5.0: # print nvidia-smi |
| 469 | cmd = ['nvidia-smi'] |
| 470 | run_command_with_popen(cmd) |
| 471 | super(TimeCostTextTestResult, self).stopTest(test) |
| 472 | |
| 473 | def addSuccess(self, test): |
| 474 | self.successes.append(test) |
nothing calls this directly
no test coverage detected