Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/657863 )

Change subject: [tests] Fix assertRaises tests in api_tests.py
......................................................................

[tests] Fix assertRaises tests in api_tests.py

Bug: T267801
Change-Id: I70e650df3ffe488bf8ccfb029c0844bf61f7e4ae
---
M tests/api_tests.py
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/tests/api_tests.py b/tests/api_tests.py
index 69c850b..8974259 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -334,6 +334,7 @@
             pi.fetch('foobar')
             with self.assertRaises(KeyError):
                 pi.__getitem__('foobar')
+            with self.assertRaises(KeyError):
                 pi.__getitem__('foobar+foobar')
         # The warning message may be different with older MW versions.
         self.assertIn('API warning (paraminfo): ', w.call_args[0][0])
@@ -360,7 +361,7 @@

         with patch.object(pywikibot, 'warning') as w:
             with self.assertRaises(KeyError):
-                pi.__getitem('query+foobar')
+                pi.__getitem__('query+foobar')
         # The warning message may be different with older MW versions.
         self.assertIn('API warning (paraminfo): ', w.call_args[0][0])

@@ -476,7 +477,7 @@
         """Test OptionSet with initialised site."""
         options = api.OptionSet(self.get_site(), 'recentchanges', 'show')
         with self.assertRaises(KeyError):
-            options.__setitems__('invalid_name', True)
+            options.__setitem__('invalid_name', True)
         with self.assertRaises(ValueError):
             options.__setitem__('anon', 'invalid_value')
         options['anon'] = True

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/657863
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I70e650df3ffe488bf8ccfb029c0844bf61f7e4ae
Gerrit-Change-Number: 657863
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to