jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/328499 )
Change subject: api_tests.py: Skip test_valid_lagpattern if there is no replication ...................................................................... api_tests.py: Skip test_valid_lagpattern if there is no replication site.siteinfo(): Issue a more clear deprecation warning by explicitly stating that siteinfo should now be used as a dictionary instead. Bug: T153838 Change-Id: I0e53be3c8cbbf6a533ddbb0b38855fcff8cf5e2f --- M pywikibot/site.py M tests/api_tests.py 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Magul: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site.py b/pywikibot/site.py index a1346ba..b3054fe 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1730,7 +1730,9 @@ def __call__(self, key='general', force=False, dump=False): """DEPRECATED: Return the entry for key or dump the complete cache.""" - issue_deprecation_warning('Calling siteinfo', 'itself', 2) + issue_deprecation_warning( + 'Calling siteinfo', 'itself as a dictionary', 2 + ) if not dump: return self.get(key, expiry=0 if force else False) else: diff --git a/tests/api_tests.py b/tests/api_tests.py index 9da8d8e..008b85e 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -1047,6 +1047,11 @@ def test_valid_lagpattern(self): """Test whether api.lagpattern is valid.""" mysite = self.get_site() + if mysite.siteinfo['dbrepllag'][0]['lag'] == -1: + raise unittest.SkipTest( + '{0} is not running on a replicated database cluster.' + .format(mysite) + ) mythrottle = DummyThrottle(mysite) mysite._throttle = mythrottle params = {'action': 'query', -- To view, visit https://gerrit.wikimedia.org/r/328499 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e53be3c8cbbf6a533ddbb0b38855fcff8cf5e2f Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Dalba <dalba.w...@gmail.com> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Magul <tomasz.magul...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits