Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1222766?usp=email )

Change subject: Tests: Update SET_NAMESPACE_TYPE_MSG for GraalPy
......................................................................

Tests: Update SET_NAMESPACE_TYPE_MSG for GraalPy

Bug: T413710
Change-Id: Ib8977f483383f8b604e4ffead3d23329e65beb10
---
M tests/api_tests.py
1 file changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/tests/api_tests.py b/tests/api_tests.py
index eddd212..57a1324 100755
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 """API test module."""
 #
-# (C) Pywikibot team, 2007-2025
+# (C) Pywikibot team, 2007-2026
 #
 # Distributed under the terms of the MIT license.
 #
@@ -25,6 +25,12 @@
 from tests.utils import FakeLoginManager


+SET_NAMESPACE_TYPE_MSG = (
+    r'int\(\) argument must be a string, a bytes-like object '
+    r"or (?:a real number|a number), not '?NoneType'?"
+)
+
+
 class TestApiFunctions(DefaultSiteTestCase):

     """API Request object test class."""
@@ -630,10 +636,7 @@
     def test_namespace_none(self) -> None:
         """Test ListGenerator set_namespace with None."""
         self.gen = api.ListGenerator(listaction='allpages', site=self.site)
-        with self.assertRaisesRegex(
-            TypeError,
-            (r'int\(\) argument must be a string, a bytes-like object '
-             r"or (?:a real number|a number), not 'NoneType'")):
+        with self.assertRaisesRegex(TypeError, SET_NAMESPACE_TYPE_MSG):
             self.gen.set_namespace(None)

     def test_namespace_multi(self) -> None:
@@ -672,10 +675,7 @@

     def test_namespace_none(self) -> None:
         """Test ListGenerator set_namespace with None."""
-        with self.assertRaisesRegex(
-            TypeError,
-            (r'int\(\) argument must be a string, a bytes-like object '
-             r"or (?:a real number|a number), not 'NoneType'")):
+        with self.assertRaisesRegex(TypeError, SET_NAMESPACE_TYPE_MSG):
             self.gen.set_namespace(None)

     def test_namespace_zero(self) -> None:

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1222766?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: Ib8977f483383f8b604e4ffead3d23329e65beb10
Gerrit-Change-Number: 1222766
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[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