jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/399344 )
Change subject: Revert "Replace assertRaises with assertRaisesRegex in
isbn_tests.py"
......................................................................
Revert "Replace assertRaises with assertRaisesRegex in isbn_tests.py"
This reverts commit 4625bef2d3a1dc0c1929cd9cb745666d75211578
due to a lot of tests failing:
https://travis-ci.org/wikimedia/pywikibot/builds/319000537
Change-Id: Ib41b30f1672a131a7cdf53b3b930fa8db2fd3e4c
---
M tests/isbn_tests.py
1 file changed, 8 insertions(+), 21 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index fc48a08..df00417 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -39,11 +39,6 @@
"""Test CosmeticChanges ISBN fix."""
- ISBN_DIGITERROR_RE = 'ISBN [0-9]+ is not [0-9]+ digits long'
- ISBN_INVALIDERROR_RE = 'Invalid ISBN found'
- ISBN_CHECKSUMERROR_RE = 'ISBN checksum of [0-9]+ is incorrect'
- ISBN_INVALIDCHARERROR_RE = 'ISBN [0-9a-zA-Z]+ contains invalid characters'
-
def test_valid_isbn(self):
"""Test ISBN."""
cc = CosmeticChangesToolkit(self.site, namespace=0)
@@ -59,25 +54,17 @@
cc = CosmeticChangesToolkit(self.site, namespace=0)
# Invalid characters
- self.assertRaisesRegex(AnyIsbnValidationException,
- (self.ISBN_DIGITERROR_RE + '|' +
- self.ISBN_INVALIDERROR_RE),
- cc.fix_ISBN, 'ISBN 0975229LOL')
+ self.assertRaises(AnyIsbnValidationException,
+ cc.fix_ISBN, 'ISBN 0975229LOL')
# Invalid checksum
- self.assertRaisesRegex(AnyIsbnValidationException,
- (self.ISBN_CHECKSUMERROR_RE + '|' +
- self.ISBN_INVALIDERROR_RE),
- cc.fix_ISBN, 'ISBN 0975229801')
+ self.assertRaises(AnyIsbnValidationException,
+ cc.fix_ISBN, 'ISBN 0975229801')
# Invalid length
- self.assertRaisesRegex(AnyIsbnValidationException,
- (self.ISBN_DIGITERROR_RE + '|' +
- self.ISBN_INVALIDERROR_RE),
- cc.fix_ISBN, 'ISBN 09752298')
+ self.assertRaises(AnyIsbnValidationException,
+ cc.fix_ISBN, 'ISBN 09752298')
# X in the middle
- self.assertRaisesRegex(AnyIsbnValidationException,
- (self.ISBN_INVALIDCHARERROR_RE + '|' +
- self.ISBN_INVALIDERROR_RE),
- cc.fix_ISBN, 'ISBN 09752X9801')
+ self.assertRaises(AnyIsbnValidationException,
+ cc.fix_ISBN, 'ISBN 09752X9801')
def test_ignore_invalid_isbn(self):
"""Test fixing ISBN numbers with an invalid
ISBN."""
--
To view, visit
https://gerrit.wikimedia.org/r/399344
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib41b30f1672a131a7cdf53b3b930fa8db2fd3e4c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>