jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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)

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4cdba4acfda166375a8edcabe74d735f86fec235
Gerrit-Change-Number: 707865
Gerrit-PatchSet: 1
Gerrit-Owner: Damian <atagar1@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged