jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307532?usp=email )

Change subject: tests: Skip non-callable test attributes in MetaTestCaseClass
......................................................................

tests: Skip non-callable test attributes in MetaTestCaseClass

Only callable attributes should be treated as test methods. This
prevents an AttributeError when a test class defines a non-callable
attribute whose name starts with 'test'.

Bug: T85660
Change-Id: I95f608ec36418275a37fe6a75846e2efb6be29fc
---
M tests/aspects.py
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/tests/aspects.py b/tests/aspects.py
index 3c23365..762e042 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -865,9 +865,11 @@

             return wrapped_method

-        tests = [attr_name
-                 for attr_name in dct
-                 if attr_name.startswith('test')]
+        tests = [
+            attr_name
+            for attr_name, attr in dct.items()
+            if attr_name.startswith('test') and callable(attr)
+        ]

         base_tests = []
         if not tests:

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I95f608ec36418275a37fe6a75846e2efb6be29fc
Gerrit-Change-Number: 1307532
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to