From e9a5a1ff70c6bc4fea0b0a38b60c0d967a9e33ec Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 17 Jun 2024 13:42:40 +0000 Subject: [PATCH] oeqa/core/runner: stub addDuration in OETestResult We have a custom TestResult implementation, and Python 3.12 added a new method addDuration() to the TestResult interface. This would be useful to implement correctly, but for now stub it out to silence the warning when running under Python 3.12: /usr/lib64/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method warnings.warn("TestResult has no addDuration method", (From OE-Core rev: 9105e2bbf3245bfa02d2f4c55a010a7d2c3da6c2) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit 2d6fff81b34476b890f6943997615fbf8d3d133f) Signed-off-by: Yoann Congal Signed-off-by: Paul Barker --- meta/lib/oeqa/core/runner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py index b683d9b80a..0d2bc3a3ed 100644 --- a/meta/lib/oeqa/core/runner.py +++ b/meta/lib/oeqa/core/runner.py @@ -78,6 +78,10 @@ class OETestResult(_TestResult): self.shownmsg.append(test.id()) break + # Python 3.12 added this, stub it out for now + def addDuration(self, test, elapsed): + pass + def logSummary(self, component, context_msg=''): elapsed_time = self.tc._run_end_time - self.tc._run_start_time self.tc.logger.info("SUMMARY:")