jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[cleanup] Decommission test_family.py

test_family was deprecated for 10 months and desupported for 2 months.
Remove the test_family.py in favour of using wikipedia family instead.

Bug: T228375
Change-Id: I946894a19c5be5bcf7109078d68e17ccf558be03
---
M pywikibot/__init__.py
D pywikibot/families/test_family.py
M tests/family_tests.py
3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index e5aaf8a..57c6aa6 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1176,8 +1176,6 @@
# Iterate through all families and look, which does apply to
# the given URL
for fam in config.family_files:
- if fam == 'test': # test_family.py is deprecated
- continue
family = Family.load(fam)
code = family.from_url(url)
if code is not None:
diff --git a/pywikibot/families/test_family.py b/pywikibot/families/test_family.py
deleted file mode 100644
index afa55b4..0000000
--- a/pywikibot/families/test_family.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Family module for test.wikipedia.org."""
-#
-# (C) Pywikibot team, 2007-2020
-#
-# Distributed under the terms of the MIT license.
-#
-from __future__ import absolute_import, division, unicode_literals
-
-from pywikibot.families.wikipedia_family import Family # noqa: F401
-from pywikibot.tools import issue_deprecation_warning
-
-issue_deprecation_warning(
- 'test_family', 'wikipedia_family', since='20190718',
- warning_class=FutureWarning)
-# Also remove the ``if fam == 'test':`` condition in pywikibot.__init__.py
-# and `` == 'test':`` condition in tests.family_tests.py
-# whenever this module is removed.
diff --git a/tests/family_tests.py b/tests/family_tests.py
index f127794..152529e 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -51,10 +51,8 @@
self.assertIsInstance(domain, basestring)
if domain.split(':', 1)[0] != 'localhost':
self.assertIn('.', domain)
- if name == 'test':
- self.assertEqual(f.name, 'wikipedia')
- else:
- self.assertEqual(f.name, name)
+
+ self.assertEqual(f.name, name)

with suppress_warnings(
'wowwiki_family.Family.languages_by_size '

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I946894a19c5be5bcf7109078d68e17ccf558be03
Gerrit-Change-Number: 586144
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)