jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620499 )

Change subject: [cleanup] Remove desupported site.Family
......................................................................

[cleanup] Remove desupported site.Family

Change-Id: I7582cfc78fa35fc90fdbe9916cf490d360472cce
---
M pywikibot/site/__init__.py
M tests/family_tests.py
2 files changed, 1 insertion(+), 62 deletions(-)

Approvals:
  Framawiki: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py
index 5052e02..ffbaa58 100644
--- a/pywikibot/site/__init__.py
+++ b/pywikibot/site/__init__.py
@@ -131,13 +131,6 @@
         return 'LoginStatus({})'.format(self)


-Family = redirect_func(pywikibot.family.Family.load,
-                       target_module='pywikibot.family.Family',
-                       old_name='Family',
-                       since='20141001',
-                       future_warning=True)
-
-
 class Namespace(Iterable, ComparableMixin):

     """
diff --git a/tests/family_tests.py b/tests/family_tests.py
index cba5a27..c9ea684 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -13,12 +13,7 @@
 from pywikibot.family import Family, SingleSiteFamily
 from pywikibot.tools import suppress_warnings

-from tests.aspects import (
-    unittest,
-    TestCase,
-    DeprecationTestCase,
-    PatchingTestCase,
-)
+from tests.aspects import PatchingTestCase, TestCase, unittest
 from tests.utils import DrySite


@@ -254,55 +249,6 @@
                     self.assertEqual(family.from_url(url), code)


-class TestOldFamilyMethod(DeprecationTestCase):
-
-    """Test cases for old site.Family method."""
-
-    UNKNOWNFAMILY_RE = 'Family unknown does not exist'
-    net = False
-
-    def test_old_site_family_function(self):
-        """Test deprecated Family function with valid families."""
-        f = pywikibot.site.Family('species')
-        self.assertEqual(f.name, 'species')
-        f = pywikibot.site.Family('osm')
-        self.assertEqual(f.name, 'osm')
-        self.assertOneDeprecationParts('pywikibot.site.Family',
-                                       'pywikibot.family.Family.load', 2)
-
-        # @deprecated warning occurs within redirect_func's call
-        # invoking the method instead of this test module.
-        self._do_test_warning_filename = False
-
-        f = pywikibot.site.Family('i18n', fatal=False)
-        self.assertEqual(f.name, 'i18n')
-        self.assertDeprecationParts('pywikibot.site.Family',
-                                    'pywikibot.family.Family.load')
-        self.assertDeprecationParts(
-            'fatal argument of pywikibot.family.Family.load')
-
-    def test_old_site_family_function_invalid(self):
-        """Test that an invalid family raised UnknownFamily exception."""
-        # As assertRaises calls the method, unittest is the module
-        # invoking the method instead of this test module.
-        self._do_test_warning_filename = False
-        self.assertRaisesRegex(
-            UnknownFamily,
-            self.UNKNOWNFAMILY_RE,
-            pywikibot.site.Family,
-            'unknown',
-            fatal=False)
-        self.assertRaisesRegex(
-            UnknownFamily,
-            self.UNKNOWNFAMILY_RE,
-            pywikibot.site.Family,
-            'unknown')
-        self.assertDeprecationParts('pywikibot.site.Family',
-                                    'pywikibot.family.Family.load')
-        self.assertDeprecationParts(
-            'fatal argument of pywikibot.family.Family.load')
-
-
 if __name__ == '__main__':  # pragma: no cover
     with suppress(SystemExit):
         unittest.main()

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620499
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7582cfc78fa35fc90fdbe9916cf490d360472cce
Gerrit-Change-Number: 620499
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to