jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] Remove deprecated Wikibase.lastrevid attribute

Change-Id: I144e624b2a9fa7a54c56baf246a9ca1590bf6f8f
---
M pywikibot/page/__init__.py
M tests/wikibase_tests.py
2 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 925952e..26fa4c2 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -3963,36 +3963,6 @@
# to the namespace case=first-letter.
self._link.title)

- def __getattribute__(self, name):
- """Low-level attribute getter. Deprecates lastrevid."""
- if name == 'lastrevid':
- issue_deprecation_warning(
- 'WikibasePage.lastrevid', 'latest_revision_id',
- warning_class=FutureWarning,
- since='20150607')
- name = '_revid'
- return super().__getattribute__(name)
-
- def __setattr__(self, attr, value):
- """Attribute setter. Deprecates lastrevid."""
- if attr == 'lastrevid':
- issue_deprecation_warning(
- 'WikibasePage.lastrevid', 'latest_revision_id',
- warning_class=FutureWarning,
- since='20150607')
- attr = '_revid'
- return super().__setattr__(attr, value)
-
- def __delattr__(self, attr):
- """Attribute deleter. Deprecates lastrevid."""
- if attr == 'lastrevid':
- issue_deprecation_warning(
- 'WikibasePage.lastrevid', 'latest_revision_id',
- warning_class=FutureWarning,
- since='20150607')
- attr = '_revid'
- return super().__delattr__(attr)
-
def namespace(self) -> int:
"""
Return the number of the namespace of the entity.
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index c28d2bf..c363406 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -70,40 +70,6 @@
self._test_page_text()


-class TestDeprecatedAttributes(WikidataTestCase, DeprecationTestCase):
-
- """Test deprecated lastrevid."""
-
- def test_lastrevid(self):
- """Test deprecated lastrevid."""
- item = ItemPage(self.get_repo(), 'Q60')
- self.assertFalse(hasattr(item, 'lastrevid'))
- item.get()
- self.assertTrue(hasattr(item, 'lastrevid'))
- self.assertIsInstance(item.lastrevid, int)
- self.assertDeprecation()
- self._reset_messages()
-
- item.lastrevid = 1
- self.assertTrue(hasattr(item, 'lastrevid'))
- self.assertTrue(hasattr(item, '_revid'))
- self.assertEqual(item.lastrevid, 1)
- self.assertEqual(item._revid, 1)
- self.assertDeprecation()
-
- def test_lastrevid_del(self):
- """Test del with deprecated lastrevid."""
- item = ItemPage(self.get_repo(), 'Q60')
- item.get()
- self.assertTrue(hasattr(item, 'lastrevid'))
- self.assertTrue(hasattr(item, '_revid'))
-
- del item.lastrevid
- self.assertFalse(hasattr(item, 'lastrevid'))
- self.assertFalse(hasattr(item, '_revid'))
- self.assertDeprecation()
-
-
class TestGeneral(WikidataTestCase):

"""General Wikibase tests."""

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I144e624b2a9fa7a54c56baf246a9ca1590bf6f8f
Gerrit-Change-Number: 666874
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged