jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1317410?usp=email )

Change subject: tests: Replace assertRaises in eventstreams tests
......................................................................

tests: Replace assertRaises in eventstreams tests

Replace assertRaises with assertRaisesRegex in
tests/eventstreams_tests.py so the tests verify the
expected exception messages in addition to the exception
types.

Bug: T154281
Change-Id: I7b53f1452b2154996521fc64f7425c568b8a9169
---
M AUTHORS.rst
M tests/eventstreams_tests.py
2 files changed, 7 insertions(+), 2 deletions(-)

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




diff --git a/AUTHORS.rst b/AUTHORS.rst
index 4fe74f5..b85b625 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -220,6 +220,7 @@
     mayankmadan
     Maze
     mehtab98
+    Mehrinshamim
     melroy
     Meno25
     Merlijn van Deen
diff --git a/tests/eventstreams_tests.py b/tests/eventstreams_tests.py
index f02db8e..91cb4a7 100755
--- a/tests/eventstreams_tests.py
+++ b/tests/eventstreams_tests.py
@@ -110,7 +110,9 @@

     def test_url_missing_streams(self) -> None:
         """Test EventStreams with url from site with missing streams."""
-        with self.assertRaises(NotImplementedError):
+        with self.assertRaisesRegex(
+                NotImplementedError,
+                'No streams specified for class'):
             EventStreams()


@@ -160,7 +162,9 @@

     def test_filter_function_settings_fail(self) -> None:
         """Test EventStreams failing filter function settings."""
-        with self.assertRaises(TypeError):
+        with self.assertRaisesRegex(
+                TypeError,
+                'is not a callable'):
             self.es.register_filter('test')

     def test_filter_settings(self) -> None:

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

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7b53f1452b2154996521fc64f7425c568b8a9169
Gerrit-Change-Number: 1317410
Gerrit-PatchSet: 4
Gerrit-Owner: Mehrinshamim <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to