jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693586 )
Change subject: [cleanup] Remove deprecated SiteInfo call method ......................................................................
[cleanup] Remove deprecated SiteInfo call method
Change-Id: Ie87833f619d609e729c82bf593217f0f328125c0 --- M pywikibot/site/_siteinfo.py M tests/site_tests.py 2 files changed, 1 insertion(+), 37 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py index 94acccf..73eb4cb 100644 --- a/pywikibot/site/_siteinfo.py +++ b/pywikibot/site/_siteinfo.py @@ -13,7 +13,7 @@
import pywikibot from pywikibot.exceptions import APIError -from pywikibot.tools import EMPTY_DEFAULT, issue_deprecation_warning +from pywikibot.tools import EMPTY_DEFAULT
_logger = 'wiki.siteinfo' @@ -345,14 +345,3 @@ return self._get_cached(key)[1]
return None - - 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 as a dictionary', since='20161221', - warning_class=FutureWarning - ) - result = self.get(key, expiry=force) - if not dump: - return result - return self._cache diff --git a/tests/site_tests.py b/tests/site_tests.py index d4b2721..69ec6da 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -48,31 +48,6 @@
cached = True
- def test_siteinfo_normal_call(self): - """Test calling the Siteinfo without setting dump.""" - old = self.site.siteinfo('general') - self.assertIn('time', old) - self.assertEqual(old, self.site.siteinfo['general']) - self.assertEqual(self.site.siteinfo('general'), old) - # Siteinfo always returns copies so it's not possible to directly - # check if they are the same dict or if they have been rerequested - # unless the content also changes so force that the content changes - self.assertNotIn('DUMMY', old) - self.site.siteinfo._cache['general'][0]['DUMMY'] = 42 - old = self.site.siteinfo('general') - self.assertIn('DUMMY', old) - self.assertNotEqual(self.site.siteinfo('general', force=True), old) - self.assertOneDeprecationParts('Calling siteinfo', - 'itself as a dictionary', - 4) - - def test_siteinfo_dump(self): - """Test calling the Siteinfo with dump=True.""" - self.assertIn('statistics', - self.site.siteinfo('statistics', dump=True)) - self.assertOneDeprecationParts('Calling siteinfo', - 'itself as a dictionary') - def test_allpages_filterredir_True(self): """Test that filterredir set to 'only' is deprecated to True.""" for page in self.site.allpages(filterredir='only', total=1):
pywikibot-commits@lists.wikimedia.org