Dalba has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/328499 )
Change subject: api_tests.py: Skip test_valid_lagpattern if there is no
replication lag
......................................................................
api_tests.py: Skip test_valid_lagpattern if there is no replication lag
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(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/99/328499/1
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: newchange
Gerrit-Change-Id: I0e53be3c8cbbf6a533ddbb0b38855fcff8cf5e2f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits