]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/core/runner: stub addDuration in OETestResult
authorRoss Burton <ross.burton@arm.com>
Mon, 17 Jun 2024 13:42:40 +0000 (13:42 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Jun 2026 13:07:38 +0000 (14:07 +0100)
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",

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/runner.py

index b683d9b80a76fa7c96367442242ad18638cf6ca1..0d2bc3a3ed0f1b85729fa3a9f7ac636327be4890 100644 (file)
@@ -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:")