jenkins-bot merged this change.
[tests] Fix site_tests.TestLogPages tests
test_logpages and test_list_namespace are sometimes failing due to
autoblock removal entries. Check for this case.
Bug: T216002
Change-Id: I3a19f62a7610cc04da28e5fcbdeda0f2614c2f78
---
M tests/site_tests.py
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 9b5424b..211f0e8 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1353,7 +1353,8 @@
self.assertLessEqual(len(le), 10)
for entry in le:
self.assertIsInstance(entry, tuple)
- self.assertIsInstance(entry[0], pywikibot.Page)
+ if not isinstance(entry[0], int): # autoblock removal entry
+ self.assertIsInstance(entry[0], pywikibot.Page)
self.assertIsInstance(entry[1], basestring)
self.assertIsInstance(
entry[2], long if PY2 and entry[2] > sys.maxint else int)
@@ -1363,6 +1364,8 @@
"""Test the deprecated site.logpages() when namespace is a list."""
le = list(self.site.logpages(namespace=[2, 3], number=10))
for entry in le:
+ if isinstance(entry[0], int): # autoblock removal entry
+ continue
try:
self.assertIn(entry[0].namespace(), [2, 3])
except HiddenKeyError as e:
To view, visit change 490290. To unsubscribe, or for help writing mail filters, visit settings.