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

Change subject: [cleanup] Remove tests for removed ParamInfo properties and 
methods
......................................................................

[cleanup] Remove tests for removed ParamInfo properties and methods

Change-Id: I529ae11490cc7a07266da23c06dd418e24e697d3
---
M tests/api_tests.py
M tests/utils.py
2 files changed, 1 insertion(+), 52 deletions(-)

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



diff --git a/tests/api_tests.py b/tests/api_tests.py
index 8d20722..2a5ccdc 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -363,30 +363,6 @@

         self.assertRaises(KeyError, pi.submodules, 'edit')

-    @suppress_warnings(
-        'pywikibot.data.api.ParamInfo.query_modules_with_limits is deprecated')
-    def test_query_modules_with_limits(self):
-        """Test query_modules_with_limits property."""
-        site = self.get_site()
-        pi = api.ParamInfo(site)
-        self.assertIn('revisions', pi.query_modules_with_limits)
-        self.assertNotIn('info', pi.query_modules_with_limits)
-
-    def test_modules(self):
-        """Test v1.8 modules exist."""
-        site = self.get_site()
-        pi = api.ParamInfo(site)
-        with suppress_warnings(
-            r'pywikibot\.data\.api\.ParamInfo.modules is deprecated for '
-            r'[\w ]+; use submodules\(\) or module_paths instead\.',
-            DeprecationWarning
-        ):
-            self.assertIn('revisions', pi.modules)
-            self.assertIn('help', pi.modules)
-            self.assertIn('allpages', pi.modules)
-            for mod in pi.modules:
-                self.assertNotIn('+', mod)
-
     def test_module_paths(self):
         """Test module paths use the complete paths."""
         pi = api.ParamInfo(self.site)
@@ -396,20 +372,6 @@
         self.assertNotIn('allpages', pi.module_paths)
         self.assertIn('query+allpages', pi.module_paths)

-    def test_prefixes(self):
-        """Test v1.8 module prefixes exist."""
-        site = self.get_site()
-        pi = api.ParamInfo(site)
-        with suppress_warnings(
-            r'pywikibot.data.api.ParamInfo.'
-            r'(?:prefixes|module_attribute_map|modules) '
-            r'is deprecated for [\w ]+; ',
-            DeprecationWarning
-        ):
-            self.assertIn('revisions', pi.prefixes)
-            self.assertIn('login', pi.prefixes)
-            self.assertIn('allpages', pi.prefixes)
-
     def test_prefix_map(self):
         """Test module prefixes use the path."""
         pi = api.ParamInfo(self.site)
@@ -484,11 +446,6 @@
         other_modules -= pi.query_modules
         self.assertLessEqual(other_modules & pi.submodules('flow'),
                              pi.submodules('flow'))
-        with suppress_warnings(
-            r'pywikibot.data.api.ParamInfo.modules is deprecated; '
-            r'use submodules\(\) or module_paths instead.'
-        ):
-            self.assertFalse(other_modules & pi.modules)


 class TestParaminfoModules(DefaultSiteTestCase):
@@ -822,9 +779,6 @@
         self.site._paraminfo['query+links'] = {
             'prefix': 'pl',
         }
-        self.site._paraminfo.query_modules_with_limits = {'querypage',
-                                                          'allpages',
-                                                          'alllinks'}

     def test_namespace_for_module_with_no_limit(self):
         """Test PageGenerator set_namespace."""
@@ -883,7 +837,6 @@
             'limit': {'max': 10},
             'namespace': {'multi': True}
         }
-        mysite._paraminfo.query_modules_with_limits = {'allpages'}
         self.gen = api.ListGenerator(listaction='allpages', site=mysite)

     def test_namespace_none(self):
diff --git a/tests/utils.py b/tests/utils.py
index e0109b2..5f77cf1 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
 """Test utilities."""
 #
-# (C) Pywikibot team, 2013-2020
+# (C) Pywikibot team, 2013-2021
 #
 # Distributed under the terms of the MIT license.
 #
@@ -234,11 +233,8 @@
     def __init__(self, *args, **kwargs):
         """Initializer."""
         super().__init__(*args, **kwargs)
-        self.modules = set()
         self.action_modules = set()
         self.query_modules = set()
-        self.query_modules_with_limits = set()
-        self.prefixes = set()

     def fetch(self, modules, _init=False):
         """Load dry data."""

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656598
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: I529ae11490cc7a07266da23c06dd418e24e697d3
Gerrit-Change-Number: 656598
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[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