]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa/loader: Ensure module names don't contain uppercase characters
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Mar 2023 14:33:01 +0000 (15:33 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 31 Mar 2023 22:30:34 +0000 (23:30 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/loader.py

index f25b5970e939231890e7dafb45a80ad17172a1bf..d12d5a055cce0878b875d41d42bb56f003c4b337 100644 (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)