public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] oeqa/loader: Ensure module names don't contain uppercase characters
@ 2023-03-30 22:44 Richard Purdie
  2023-03-30 23:16 ` [OE-core] " Martin Jansa
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2023-03-30 22:44 UTC (permalink / raw)
  To: openembedded-core

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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index f25b5970e93..d12d5a055cc 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -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)
 
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-30 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-30 22:44 [PATCH] oeqa/loader: Ensure module names don't contain uppercase characters Richard Purdie
2023-03-30 23:16 ` [OE-core] " Martin Jansa
2023-03-30 23:28   ` Richard Purdie
2023-03-30 23:44     ` Martin Jansa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox