jenkins-bot submitted this change.

View Change


Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
[tests] Enable TestCosmeticChangesISBN tests

Bug: T356737

Change-Id: Ifb2e73352fe1193db91e4413029d27d27f70665d
---
M tests/cosmetic_changes_tests.py
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index 4cc48b3..251d38b 100755
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Test cosmetic_changes module."""
#
-# (C) Pywikibot team, 2015-2022
+# (C) Pywikibot team, 2015-2024
#
# Distributed under the terms of the MIT license.
#
@@ -13,8 +13,7 @@
from pywikibot import Page
from pywikibot.cosmetic_changes import CANCEL, CosmeticChangesToolkit
from pywikibot.site import NamespacesDict
-from pywikibot.tools import has_module
-from tests.aspects import TestCase
+from tests.aspects import TestCase, require_modules


class TestCosmeticChanges(TestCase):
@@ -548,6 +547,7 @@
# Once numbering fixes are enabled we can add tests.


+@require_modules('stdnum')
class TestCosmeticChangesISBN(TestCosmeticChanges):

"""Test CosmeticChanges ISBN fix."""
@@ -561,13 +561,6 @@
ISBN_INVALIDCHARERROR_RE = 'ISBN [0-9a-zA-Z]+ contains invalid characters'
ISBN_INVALIDLENGTHERROR_RE = 'The number has an invalid length'

- @classmethod
- def setUpClass(cls):
- """Skip tests if isbn libraries are missing."""
- if not has_module('stdnum', version='1.18'):
- raise unittest.SkipTest('python-stdnum is not available.')
- super().setUpClass()
-
def test_valid_isbn(self):
"""Test ISBN."""
text = self.cct.fix_ISBN(' ISBN 097522980x ')

To view, visit change 997788. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifb2e73352fe1193db91e4413029d27d27f70665d
Gerrit-Change-Number: 997788
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged