jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/632686 )

Change subject: [tests] remove Python 2 code in isbn_tests.py
......................................................................

[tests] remove Python 2 code in isbn_tests.py

- remove Python 2 related code in isbn_tests.py
- fix skip message to "python-stdnum" package
- increase requirements to current release to
  prevent outdated isbn numbers

Change-Id: I365d4120fed76dd1d5885ac5e99e5c7637cf0145
---
M requirements.txt
M setup.py
M tests/isbn_tests.py
3 files changed, 10 insertions(+), 12 deletions(-)

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



diff --git a/requirements.txt b/requirements.txt
index 69c1e8f..d02bb32 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -30,7 +30,7 @@
 pydot >= 1.2

 # cosmetic_changes and scripts/isbn
-python-stdnum >= 1.13
+python-stdnum >= 1.14

 # GUI
 Pillow >= 6.2.2
diff --git a/setup.py b/setup.py
index 08a3c1f..35af98d 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@
 extra_deps = {
     # Core library dependencies
     'eventstreams': ['sseclient!=0.0.23,!=0.0.24,>=0.0.18'],
-    'isbn': ['python-stdnum>=1.13'],
+    'isbn': ['python-stdnum>=1.14'],
     'Graphviz': ['pydot>=1.2'],
     'Google': ['google>=1.7'],
     'mwparserfromhell': ['mwparserfromhell>=0.3.3'],
diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index e4bbe26..ab7e4f4 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -5,8 +5,6 @@
 #
 # Distributed under the terms of the MIT license.
 #
-from __future__ import absolute_import, division, unicode_literals
-
 import pywikibot

 try:
@@ -156,12 +154,12 @@
         """Patch the Bot class to avoid an actual write."""
         self._original_userPut = Bot.userPut
         Bot.userPut = userPut_dummy
-        super(TestIsbnBot, self).setUp()
+        super().setUp()

     def tearDown(self):
         """Unpatch the Bot class."""
         Bot.userPut = self._original_userPut
-        super(TestIsbnBot, self).tearDown()
+        super().tearDown()

     def test_isbn(self):
         """Test the ISBN bot."""
@@ -191,7 +189,7 @@
     @classmethod
     def setUpClass(cls):
         """Set up test class."""
-        super(TestIsbnWikibaseBot, cls).setUpClass()
+        super().setUpClass()

         # Check if the unit test item page and the property both exist
         item_ns = cls.get_repo().item_namespace
@@ -220,13 +218,13 @@
         Claim.setTarget = setTarget_dummy
         TestIsbnWikibaseBot._original_editEntity = ItemPage.editEntity
         ItemPage.editEntity = editEntity_dummy
-        super(TestIsbnWikibaseBot, self).setUp()
+        super().setUp()

     def tearDown(self):
         """Unpatch the dummy methods."""
         Claim.setTarget = TestIsbnWikibaseBot._original_setTarget
         ItemPage.editEntity = TestIsbnWikibaseBot._original_editEntity
-        super(TestIsbnWikibaseBot, self).tearDown()
+        super().tearDown()

     def test_isbn_format(self):
         """Test format using the bot and wikibase."""
@@ -254,9 +252,9 @@

 def setUpModule():  # noqa: N802
     """Skip tests if isbn libraries are missing."""
-    if not (has_module('stdnum', version='1.13')
-            or has_module('isbnlib', version='3.9.10')):
-        raise unittest.SkipTest('neither python-stdlib nor isbnlib available.')
+    if not (has_module('stdnum', version='1.14')
+            or has_module('isbnlib', version='3.10.3')):
+        raise unittest.SkipTest('neither python-stdnum nor isbnlib available.')


 if __name__ == '__main__':  # pragma: no cover

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/632686
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: I365d4120fed76dd1d5885ac5e99e5c7637cf0145
Gerrit-Change-Number: 632686
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Hazard-SJ <[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