jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/523689 )

Change subject: test(test_newfiles): suppress DeprecationWarning
......................................................................

test(test_newfiles): suppress DeprecationWarning

Used to show the following warning:

/home/travis/build/wikimedia/pywikibot/tests/site_tests.py:808:\
 DeprecationWarning: pywikibot.site.APISite.newfiles is deprecated for\
 2 years; use APISite.logevents(logtype="upload") instead.

Change-Id: Idd9f379d2a9bb4e5178b57ab10c732ea4579f0fc
---
M tests/site_tests.py
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/site_tests.py b/tests/site_tests.py
index beed649..7382d75 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -805,7 +805,9 @@
     def test_newfiles(self):
         """Test the site.newfiles() method."""
         my_site = self.get_site()
-        the_list = list(my_site.newfiles(total=10))
+        with suppress_warnings(category=DeprecationWarning):
+            gen = my_site.newfiles(total=10)
+        the_list = list(gen)
         self.assertLessEqual(len(the_list), 10)
         self.assertTrue(all(isinstance(tup, tuple) and len(tup) == 4
                             for tup in the_list))

--
To view, visit https://gerrit.wikimedia.org/r/523689
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: Idd9f379d2a9bb4e5178b57ab10c732ea4579f0fc
Gerrit-Change-Number: 523689
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to