jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/523684 )
Change subject: test(TestNotification.test_from_json): suppress deprecation warning
......................................................................
test(TestNotification.test_from_json): suppress deprecation warning
The test used to show the following warning:
/home/travis/build/wikimedia/pywikibot/tests/echo_tests.py:47:\
DeprecationWarning: pywikibot.echo.Notification.id is deprecated for\
6 months and 11 days; use event_id instead.
self.assertEqual(notif.id, self.data['id'])
/home/travis/build/wikimedia/pywikibot/tests/echo_tests.py:48:\
DeprecationWarning: pywikibot.echo.Notification.id is deprecated for\
6 months and 11 days; use event_id instead.
self.assertEqual(int(notif.id), notif.event_id)
Change-Id: I249340faa4a393bdb9f2d90ed79930f5a15ab3f7
---
M tests/echo_tests.py
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/echo_tests.py b/tests/echo_tests.py
index 88d195e..23cb958 100644
--- a/tests/echo_tests.py
+++ b/tests/echo_tests.py
@@ -10,6 +10,7 @@
import pywikibot
from pywikibot.echo import Notification
+from pywikibot.tools import suppress_warnings
from tests.aspects import unittest, DefaultDrySiteTestCase
@@ -44,8 +45,10 @@
notif = Notification.fromJSON(self.get_site(), self.data)
self.assertIsInstance(notif, Notification)
self.assertEqual(notif.site, self.get_site())
- self.assertEqual(notif.id, self.data['id'])
- self.assertEqual(int(notif.id), notif.event_id)
+ with suppress_warnings(category=DeprecationWarning):
+ notif_id = notif.id
+ self.assertEqual(notif_id, self.data['id'])
+ self.assertEqual(int(notif_id), notif.event_id)
self.assertEqual(notif.type, self.data['type'])
self.assertEqual(notif.category, self.data['category'])
self.assertIsInstance(notif.timestamp, pywikibot.Timestamp)
--
To view, visit
https://gerrit.wikimedia.org/r/523684
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: I249340faa4a393bdb9f2d90ed79930f5a15ab3f7
Gerrit-Change-Number: 523684
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)