jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/337351 )
Change subject: testBaseMethods: Don't fail when repository code is not found in disambcatname ......................................................................
testBaseMethods: Don't fail when repository code is not found in disambcatname
`site.disambcategory` method raises a different error message when `site.data_repository().code` is not found in `site.family.disambcatname`. Adjust the test to catch that error.
Bug: T153594 Change-Id: I51529dd105e491e2b13aa8b9c4e8988d0bfe2dc1 --- M tests/site_tests.py 1 file changed, 9 insertions(+), 1 deletion(-)
Approvals: Lokal Profil: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index 5b43ccf..cbe5786 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -281,7 +281,15 @@ try: dabcat = mysite.disambcategory() except pywikibot.Error as e: - self.assertIn('No disambiguation category name found', str(e)) + try: + self.assertIn('No disambiguation category name found', str(e)) + except AssertionError: + self.assertIn( + 'No {repo} qualifier found for disambiguation category ' + 'name in {fam}_family file'.format( + repo=mysite.data_repository().family.name, + fam=mysite.family.name), + str(e)) else: self.assertIsInstance(dabcat, pywikibot.Category)
pywikibot-commits@lists.wikimedia.org