jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/516194 )
Change subject: [tests] Suppress deprecation warning for languages_by_size at wowwiki ......................................................................
[tests] Suppress deprecation warning for languages_by_size at wowwiki
Change-Id: I50b562c851c30d0cbc0916f6023794f28d61577f --- M tests/family_tests.py 1 file changed, 7 insertions(+), 3 deletions(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/family_tests.py b/tests/family_tests.py index 0d4c70f..d33c2a8 100644 --- a/tests/family_tests.py +++ b/tests/family_tests.py @@ -11,7 +11,7 @@
from pywikibot.exceptions import UnknownFamily from pywikibot.family import Family, SingleSiteFamily -from pywikibot.tools import StringTypes as basestring +from pywikibot.tools import StringTypes as basestring, suppress_warnings
from tests.aspects import ( unittest, @@ -50,8 +50,12 @@ if domain.split(':', 1)[0] != 'localhost': self.assertIn('.', domain) self.assertEqual(f.name, name) - self.assertIsInstance(f.languages_by_size, list) - self.assertGreaterEqual(set(f.langs), set(f.languages_by_size)) + + with suppress_warnings( + 'wowwiki_family.Family.languages_by_size is deprecated'): + self.assertIsInstance(f.languages_by_size, list) + self.assertGreaterEqual(set(f.langs), set(f.languages_by_size)) + if isinstance(f, SingleSiteFamily): self.assertIsNotNone(f.code) self.assertIsNotNone(f.domain)