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

Change subject: Tests: Skip resp.apparent_encoding test in CharsetTestCase for 
GraalPy
......................................................................

Tests: Skip resp.apparent_encoding test in CharsetTestCase for GraalPy

Bug: T414215
Change-Id: I05b5f46d03f6417232b70c79eb0f3891f5116b3b
---
M tests/http_tests.py
1 file changed, 7 insertions(+), 6 deletions(-)

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




diff --git a/tests/http_tests.py b/tests/http_tests.py
index a9a073a..ad86603 100755
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 """Tests for http module."""
 #
-# (C) Pywikibot team, 2014-2025
+# (C) Pywikibot team, 2014-2026
 #
 # Distributed under the terms of the MIT license.
 #
@@ -12,6 +12,7 @@
 import warnings
 from contextlib import suppress
 from http import HTTPStatus
+from platform import python_implementation
 from unittest.mock import patch

 import requests
@@ -439,8 +440,7 @@
         invalid_charsets = ('utf16', 'win-1251')
         for charset in invalid_charsets:
             with self.subTest(charset=charset):
-                resp = CharsetTestCase._create_response(
-                    data=CharsetTestCase.LATIN1_BYTES)
+                resp = self._create_response(data=CharsetTestCase.LATIN1_BYTES)

                 with patch('pywikibot.warning'):  # Ignore WARNING:
                     resp.encoding = http._decide_encoding(resp, charset)
@@ -449,9 +449,10 @@
                 self.assertEqual(resp.content, CharsetTestCase.LATIN1_BYTES)

                 # test Response.apparent_encoding
-                self.assertEqual(resp.text, str(resp.content,
-                                                resp.apparent_encoding,
-                                                errors='replace'))
+                if python_implementation() != 'GraalVM':  # T414220
+                    self.assertEqual(resp.text, str(resp.content,
+                                                    resp.apparent_encoding,
+                                                    errors='replace'))

     def test_get_charset_from_content_type(self) -> None:
         """Test get_charset_from_content_type function."""

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1224995?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: I05b5f46d03f6417232b70c79eb0f3891f5116b3b
Gerrit-Change-Number: 1224995
Gerrit-PatchSet: 2
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