public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] oeqa/loader: Ensure module names don't contain uppercase characters
Date: Thu, 30 Mar 2023 23:44:04 +0100	[thread overview]
Message-ID: <20230330224404.51167-1-richard.purdie@linuxfoundation.org> (raw)

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



             reply	other threads:[~2023-03-30 22:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 22:44 Richard Purdie [this message]
2023-03-30 23:16 ` [OE-core] [PATCH] oeqa/loader: Ensure module names don't contain uppercase characters Martin Jansa
2023-03-30 23:28   ` Richard Purdie
2023-03-30 23:44     ` Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230330224404.51167-1-richard.purdie@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox