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

Change subject: tests: Fix TestIsIpAddress when testing IPv4
......................................................................

tests: Fix TestIsIpAddress when testing IPv4

Leading zeros are no longer tolerated since Python 3.9.5,
but they are valid for older Pythons.

Bug: T430144
Change-Id: I125a54e45d6a0c610b0fb8334577b4e9be5d5279
---
M tests/tools_tests.py
1 file changed, 6 insertions(+), 1 deletion(-)

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




diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index e3e2edb..c8cebf0 100755
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -20,6 +20,7 @@

 from pywikibot import config, tools
 from pywikibot.tools import (
+    PYTHON_VERSION,
     SevenZipFile,
     cached,
     classproperty,
@@ -855,7 +856,6 @@
             None,
             '',
             '0.0.0',
-            '01.02.03.04',
             '1.2.3.256',
             '1.2.3.-1',
             '1.2.3.4.5',
@@ -869,6 +869,11 @@
             with self.subTest(ip_address=address):
                 self.assertFalse(is_ip_address(address))

+        address = '01.02.03.04'
+        with self.subTest(ip_address=address):
+            self.assertEqual(is_ip_address(address),
+                             PYTHON_VERSION < (3, 9, 5))
+
     def test_valid_ipv6_addresses(self) -> None:
         """Check with valid IPv6 addresses."""
         valid_addresses = (

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