jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693498 )
Change subject: [cleanup] Remove deprecated LogEntry title method ......................................................................
[cleanup] Remove deprecated LogEntry title method
This method was deprecated almost six years ago. Cleaning it up.
Change-Id: Ie5d35b09b9838258494285bc21f2e7feed4f1c2c --- M pywikibot/logentries.py M tests/logentries_tests.py 2 files changed, 1 insertion(+), 32 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py index 106448d..4bade5d 100644 --- a/pywikibot/logentries.py +++ b/pywikibot/logentries.py @@ -11,7 +11,6 @@ import pywikibot from pywikibot.backports import List from pywikibot.exceptions import Error, HiddenKeyError -from pywikibot.tools import deprecated
_logger = 'wiki' @@ -102,16 +101,6 @@
return self[self._expected_type]
- @deprecated('page()', since='20150617', future_warning=True) - def title(self): - """ - DEPRECATED: Alias for page(). - - This is going to be replaced by just returning the title as a string - instead of a Page instance. - """ - return self.page() - def page(self): """ Page on which action was performed. diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py index f4d5653..990acf2 100644 --- a/tests/logentries_tests.py +++ b/tests/logentries_tests.py @@ -17,7 +17,7 @@ UserTargetLogEntry, ) from tests import unittest_print -from tests.aspects import DeprecationTestCase, MetaTestCaseClass, TestCase +from tests.aspects import MetaTestCaseClass, TestCase
class TestLogentriesBase(TestCase): @@ -284,26 +284,6 @@ self.assertEqual(type(le4), type(le5))
-class TestDeprecatedMethods(TestLogentriesBase, DeprecationTestCase): - - """Test cases for deprecated logentry methods.""" - - def test_logentry_title(self, key): - """Test title and page return the same instance.""" - # Request multiple log entries in the hope that one might have no - # title entry - self._do_test_warning_filename = False # T271044 - for logentry in self.site.logevents(total=5): - if 'title' in logentry.data: # title may be missing - self.assertIsInstance(logentry.title(), pywikibot.Page) - self.assertIs(logentry.title(), logentry.page()) - else: - with self.assertRaises(KeyError): - logentry.title() - self.assertDeprecation() # T271044 - self._reset_messages() # T271044 - - if __name__ == '__main__': # pragma: no cover with suppress(SystemExit): unittest.main()
pywikibot-commits@lists.wikimedia.org