Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1361084?usp=email )
Change subject: tests: Skip logenttries_tests for Lobbypedia
......................................................................
tests: Skip logenttries_tests for Lobbypedia
'old' tests should be made with any wiki with oldest supported
MediaWiki release. Lobbypedia was updated from 1.31.6 to 1.43.9.
Skip these tests until another wiki was found for such tests.
Bug: T443109
Change-Id: Id97af53969faca9fc402f8434c10ae7146bc32b6
---
M tests/logentries_tests.py
1 file changed, 9 insertions(+), 15 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Verified; Looks good to me, approved
diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py
index a4fa895..bb49cfb 100755
--- a/tests/logentries_tests.py
+++ b/tests/logentries_tests.py
@@ -12,11 +12,7 @@
from contextlib import suppress
import pywikibot
-from pywikibot.exceptions import (
- ApiTimeoutError,
- HiddenKeyError,
- NoMoveTargetError,
-)
+from pywikibot.exceptions import HiddenKeyError, NoMoveTargetError
from pywikibot.family import AutoFamily
from pywikibot.logentries import (
LogEntryFactory,
@@ -59,18 +55,15 @@
'https://lobbypedia.de/wiki/Hauptseite'),
'code': 'de',
'target': None,
+ 'version': '1.31.6',
}
}
- @classmethod
- def setUpClass(cls) -> None:
- """Skip tests when the Lobbypedia API times out during setup."""
- try:
- super().setUpClass()
- except ApiTimeoutError as e:
- if e.site and e.site.family.name == 'lobbypedia':
- raise unittest.SkipTest(f'API timeout on Lobbypedia: {e}')
- raise
+ def setUp(self) -> None:
+ """Skip Lobbypedia tests which was updated to MW 1.43.9."""
+ if self._testMethodName.endswith('_old'):
+ self.skipTest('Lobbypedia was updated to MW 1.43.9 (T443109).')
+ super().setUp()
def _get_logentry(self, logtype):
"""Retrieve a single log entry."""
@@ -78,7 +71,8 @@
# This is an assertion as the tests don't make sense with newer
# MW versions and otherwise it might not be visible that the test
# isn't run on an older wiki.
- self.assertEqual(self.site.mw_version, '1.31.6')
+ self.assertEqual(self.site.mw_version,
+ self.sites[self.site_key]['version'])
with skipping(StopIteration,
msg=f'No entry found for {logtype!r}'):
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1361084?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: Id97af53969faca9fc402f8434c10ae7146bc32b6
Gerrit-Change-Number: 1361084
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[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]