Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/645531 )
Change subject: [bugfix] enable "old" logentries tests ......................................................................
[bugfix] enable "old" logentries tests
- use wowwiki:hu because cs is very small - skip tests if there aren't any entries - add tests for wowwiki:en
Bug: T268971 Change-Id: I1c7bf725aabe89608fe9932604ad5479656340d2 --- M tests/logentries_tests.py 1 file changed, 11 insertions(+), 2 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py index 603761d..9b7f1b9 100644 --- a/tests/logentries_tests.py +++ b/tests/logentries_tests.py @@ -44,9 +44,14 @@ 'code': 'de', 'target': 'Hauptseite', }, + 'enwow': { + 'family': 'wowwiki', + 'code': 'en', + 'target': None, + }, 'old': { 'family': 'wowwiki', - 'code': 'cs', + 'code': 'hu', 'target': None, } } @@ -58,7 +63,11 @@ # MW versions and otherwise it might not be visible that the test # isn't run on an older wiki. self.assertLess(self.site.mw_version, '1.20') - return next(iter(self.site.logevents(logtype=logtype, total=1))) + try: + le = next(iter(self.site.logevents(logtype=logtype, total=1))) + except StopIteration: + self.skipTest('No entry found for {!r}'.format(logtype)) + return le
def _test_logevent(self, logtype): """Test a single logtype entry."""