[RFC PATCH v2] tests/functional: tell pylint not to check c-modules

Alex Bennée posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260612140531.3530387-1-alex.bennee@linaro.org
Maintainers: Thomas Huth <th.huth+qemu@posteo.eu>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, "Daniel P. Berrangé" <berrange@redhat.com>
tests/functional/pylintrc | 1 +
1 file changed, 1 insertion(+)
[RFC PATCH v2] tests/functional: tell pylint not to check c-modules
Posted by Alex Bennée 1 month, 1 week ago
To fix:

  qemu-test.test_pylint "/home/alex/lsrc/qemu.git/tests/functional/arm/test_integratorcp.py:83: I1101: Module 'cv2' has no 'imread' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)"

Manually running python3 showed I could indeed import cv2 and call
those functions. Rather than allowing pylint to introspect lets just
tell it to skip c modules.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/functional/pylintrc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/functional/pylintrc b/tests/functional/pylintrc
index 049c3e76f12..949bea611fe 100644
--- a/tests/functional/pylintrc
+++ b/tests/functional/pylintrc
@@ -58,6 +58,7 @@ confidence=HIGH,
 # no Warning level messages displayed, use "--disable=all --enable=classes
 # --disable=W".
 disable=bad-inline-option,
+        c-extension-no-member,
         consider-using-f-string,
         file-ignored,
         fixme,
-- 
2.47.3


Re: [RFC PATCH v2] tests/functional: tell pylint not to check c-modules
Posted by Daniel P. Berrangé 1 month, 1 week ago
On Fri, Jun 12, 2026 at 03:05:31PM +0100, Alex Bennée wrote:
> To fix:
> 
>   qemu-test.test_pylint "/home/alex/lsrc/qemu.git/tests/functional/arm/test_integratorcp.py:83: I1101: Module 'cv2' has no 'imread' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)"
> 
> Manually running python3 showed I could indeed import cv2 and call
> those functions. Rather than allowing pylint to introspect lets just
> tell it to skip c modules.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/functional/pylintrc | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|