jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/707865 )
Change subject: [bugfix] Tests fail if family is named 'test' ......................................................................
[bugfix] Tests fail if family is named 'test'
This file had a vestigial conditional for the 'test' family that was removed in commit 66d88aa. This causes a test failure for me because I coincidently chose the same name.
====================================================================== FAIL: test_each_family (tests.family_tests.TestFamilyUrlRegex) (family='test') Test each family builds a working regex. ---------------------------------------------------------------------- Traceback (most recent call last): File "pywikibot/tests/family_tests.py", line 235, in test_each_family self.assertEqual(family.from_url(url), code) File "pywikibot/pywikibot/family.py", line 864, in from_url site = pywikibot.Site(code, self.name) File "pywikibot/tests/family_tests.py", line 161, in Site self.assertEqual(fam, 'wikipedia') AssertionError: 'test' != 'wikipedia' - test + wikipedia
Bug: T287332 Change-Id: I4cdba4acfda166375a8edcabe74d735f86fec235 --- M tests/family_tests.py 1 file changed, 1 insertion(+), 4 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/family_tests.py b/tests/family_tests.py index d82d723..94ed871 100644 --- a/tests/family_tests.py +++ b/tests/family_tests.py @@ -157,10 +157,7 @@ self.assertEqual(args, ()) self.assertEqual(kwargs, {}) self.assertEqual(code, self.current_code) - if self.current_family == 'test': - self.assertEqual(fam, 'wikipedia') - else: - self.assertEqual(fam, self.current_family) + self.assertEqual(fam, self.current_family) site = DrySite(code, fam, None) site._siteinfo._cache['general'] = ({'articlepath': self.article_path}, True)
pywikibot-commits@lists.wikimedia.org