MCPcopy
hub / github.com/modelscope/ms-swift / stopTest

Method stopTest

tests/run.py:462–471  ·  view source on GitHub ↗
(self, test)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

run_command_with_popenFunction · 0.85

Tested by

no test coverage detected