jenkins-bot merged this change.
[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(-)
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 change 567264. To unsubscribe, or for help writing mail filters, visit settings.