oeqa/loader: Ensure module names don't contain uppercase characters

Python modules aren't supposed to have uppercase characters in their names
according to python conventions. We have regexs in the code which work
on that assumption too. Rather than showing errors under some filtering
situations, make it clear and error if a problematic name is seen.

(From OE-Core rev: 7964a6ee54e881a6128707a7f2a42eec2ed63881)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-03-30 15:33:01 +01:00
parent 5a34ddf76d
commit f67258fcbf

View File

@@ -316,6 +316,9 @@ class OETestLoader(unittest.TestLoader):
module_name_small in self.modules) \
else False
if any(c.isupper() for c in module.__name__):
raise SystemExit("Module '%s' contains uppercase characters and this isn't supported. Please fix the module name." % module.__name__)
return (load_module, load_underscore)