diff mbox series

[25/41] oeqa/core/loader: Simplify the _make_failed_test override

Message ID 20261115084845.701136-25-richard.purdie@linuxfoundation.org
State New
Headers show
Series [01/41] oeqa/loader: Drop code for pre python 3.5 | expand

Commit Message

Richard Purdie Nov. 15, 2026, 8:48 a.m. UTC
We now require python 3.9 or later so we can drop the python 3.4
era compatibility code.

AI-Generated: Uses Claude Opus 5.5
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/core/loader.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index 5e96988b7a9..719e2a8a4c3 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -8,7 +8,6 @@  import os
 import re
 import sys
 import unittest
-import inspect
 
 from oeqa.core.utils.path import findFile
 from oeqa.core.utils.test import getSuiteModules, getCaseID
@@ -23,12 +22,8 @@  from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
 #
 # For our purposes, it is better to raise the exceptions in the loading
 # step rather than waiting to run the test suite.
-#
-# Generate the function definition because this differ across python versions
-# Python >= 3.4.4 uses tree parameters instead four but for example Python 3.5.3
-# ueses four parameters so isn't incremental.
-_failed_test_args = inspect.getfullargspec(unittest.loader._make_failed_test).args
-exec("""def _make_failed_test(%s): raise exception""" % ', '.join(_failed_test_args))
+def _make_failed_test(methodname, exception, *args, **kwargs):
+    raise exception
 unittest.loader._make_failed_test = _make_failed_test
 
 def _find_duplicated_modules(suite, directory):