jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/567264 )
Change subject: [tests] suppress_warnings for some page_tests
......................................................................
[tests] suppress_warnings for some page_tests
suppress_warnings accepts regex strings as parameter.
Use them to suppress depecation warnings as expected.
Change-Id: I729d438e7c58a8ebe08b1aea4b0722b4c95ca2bb
---
M tests/page_tests.py
1 file changed, 5 insertions(+), 4 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/page_tests.py b/tests/page_tests.py
index b6c6152..fc2d8fc 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -451,16 +451,17 @@
# we only check that the returned objects are of correct type.
self.assertIsInstance(mainpage.get(), unicode)
with suppress_warnings(
- 'pywikibot.page.BasePage.latestRevision is deprecated; '
- 'use latest_revision_id instead.'):
+ r'pywikibot\.page\.BasePage\.latestRevision '
+ r'is deprecated[\s\w]+; '
+ r'use latest_revision_id instead\.'):
self.assertIsInstance(mainpage.latestRevision(), int)
self.assertIsInstance(mainpage.userName(), unicode)
self.assertIsInstance(mainpage.isIpEdit(), bool)
self.assertIsInstance(mainpage.exists(), bool)
self.assertIsInstance(mainpage.isRedirectPage(), bool)
with suppress_warnings(
- 'pywikibot.page.BasePage.isEmpty is deprecated; '
- 'use interwiki.page_empty_check(page) instead.'):
+ r'pywikibot\.page\.BasePage\.isEmpty is deprecated[\s\w]+; '
+ r'use interwiki\.page_empty_check\(page\) instead\.'):
self.assertIsInstance(mainpage.isEmpty(), bool)
self.assertIsInstance(mainpage.isDisambig(), bool)
self.assertIsInstance(mainpage.canBeEdited(), bool)
--
To view, visit
https://gerrit.wikimedia.org/r/567264
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I729d438e7c58a8ebe08b1aea4b0722b4c95ca2bb
Gerrit-Change-Number: 567264
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)